Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <array>
- using namespace std;
- void mostrar_matriz (const array<array<int,3>,3>& a);
- void mostrar_matriz_2 (const array<array<int,3>,3>& a);
- int main()
- {
- array<array<int,3>,3> a = {1,2,3,4,5,6,7,8,9};
- mostrar_matriz(a);
- mostrar_matriz_2(a);
- return 0;
- }
- void mostrar_matriz (const array<array<int,3>,3>& a)
- {
- for (int i=0; i<3; i++)
- {
- for (int j=0; j<3; j++)
- cout << a.at(i).at(j) << ' ';
- cout << endl;
- }
- cout << endl;
- }
- void mostrar_matriz_2 (const array<array<int,3>,3>& a)
- {
- for (auto f : a)
- {
- for (auto c : f)
- cout << c << ' ';
- cout << endl;
- }
- cout << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement