1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
using namespace std; int () { int maxx,minn,total=0; int table[3][4]; for(int i=0;i<3;i++) { for(int j=0;j<4;j++) { cin>>table[i][j]; if(i==0&&j==0) { maxx=minn=total=table[0][0]; } else { total+=table[i][j]; if(table[i][j]>maxx) { maxx=table[i][j]; } if(minn>table[i][j]) { minn=table[i][j]; } } } } cout<<"the max number is"<<maxx<<endl; cout<<"the min number is"<<minn<<endl; cout<<"the total is"<<total<<endl; return 0; }
|
近期评论