-
-
Save parzibyte/aa90e9eafb662c724e1c98ad94bbd343 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
// https://parzibyte.me/blog | |
#include <iostream> | |
#include <array> | |
using namespace std; | |
int main() | |
{ | |
array<string, 5> nombres = { | |
"Luis", | |
"Atlas", | |
"Link", | |
"Leon", | |
"Fontaine", | |
}; | |
for (size_t i = 0; i < nombres.size(); i++) | |
{ | |
string nombreActual = nombres.at(i); | |
// También podría ser con: | |
// nombreActual = nombres[i] | |
cout << "Un nombre: " << nombreActual << endl; | |
} | |
array<int, 5> numeros = {1, 2, 3, 4, 5}; | |
for (size_t i = 0; i < numeros.size(); i++) | |
{ | |
int numeroActual = numeros[i]; | |
cout << "Un número: " << numeroActual << endl; | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment