-
-
Save parzibyte/6e7b3e58c7b0725edec0b690e0ab64fb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
// https://parzibyte.me/blog | |
string fecha = "20211128"; | |
string anio = fecha.substr(0, 4); | |
string mes = fecha.substr(4, 2); | |
string dia = fecha.substr(6, 2); | |
// Extraer solo el nombre. Desde 0 tomar 4 caracteres | |
cout << "Año " << anio << " Mes " << mes << " Día " << dia << endl; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment