|
|
- #include<iostream>
- using namespace std ;
- int main()
- {
- int total = 2 ;
- int IntBox[total][total];
- int LoopA,LoopB,sum;
-
- sum=0;
- for(LoopA=0;LoopA<=total;LoopA++)
- {
- for(LoopB=0;LoopB<=total;LoopB++)
- {
- sum=sum+1;
- IntBox[LoopA][LoopB] = sum ;
- cout << "Matrix[" << (LoopA+1) << "*" << (LoopB+1) << "] = " << IntBox[LoopA][LoopB] << endl ;
- }
- }
- cout << endl << endl ;
-
- sum=0 ;
- for(LoopA=0;LoopA<=total;LoopA++)
- {
- for(LoopB=0;LoopB<=total;LoopB++)
- {
- sum=sum+1;
- IntBox[LoopA][LoopB] = 2*(sum) ;
- cout << "Matrix[" << (LoopA+1) << "*" << (LoopB+1) << "] = " << IntBox[LoopA][LoopB] << endl ;
- }
- }
- cout << endl << endl ;
-
- system("PAUSE") ;
- return 0 ;
- }
複製代碼 |
|