1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
#include <cstdlib>
#include <iostream>
using namespace std;
const int NUMROWS=3;
const int NUMCOLS=4;
int main(int argc, char *argv[])
{
int i, j, total=0, val[NUMROWS][NUMCOLS]={8,16,9,52,3,15,27,6,14,25,2,10};
for(i=0;i<NUMROWS;i++)
{
cout<<endl;
for(j=0;j<NUMCOLS;j++)
cout<<val[i][j]<<" ";
total+=val[0][j];
}
cout<<endl<<endl;
cout<<total<<endl;
system("PAUSE");
return 0;
}
|