1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
| #include "stdafx.h"
#include <iostream>
int _tmain(int argc, _TCHAR* argv[])
{
int a[5][5]={{1, 2, 3, 4, 5},{1, 2, 3, 4, 5},{1, 2, 3, 4, 5},{1, 2, 3, 4, 5},{1, 2, 3, 4, 5}};
int b[5][5]={{5, 4, 3, 2, 1},{5, 4, 3, 2, 1},{5, 4, 3, 2, 1},{5, 4, 3, 2, 1},{5, 4, 3, 2, 1}};
for (int i=0; i<5; i++)
{
for (int j=0; j<5; j++)
{
a[i][j]+=b[i][j];
std::cout << a[i][j] << "\t";
}
std::cout << "\n";
}
system("pause");
return 0;
} |