SHOW:
|
|
- or go back to the newest paste.
| 1 | #pragma hdrstop | |
| 2 | #include <iostream.h> | |
| 3 | #include <conio.h> | |
| 4 | ||
| 5 | //--------------------------------------------------------------------------- | |
| 6 | ||
| 7 | #pragma argsused | |
| 8 | void main() | |
| 9 | {const int N=5, M=5;
| |
| 10 | - | int a[N][M],b[N],i,j,max,k=0; |
| 10 | + | int a[N][M],i,j,max,k=0; |
| 11 | for(i=0;i<N;i++) | |
| 12 | for(j=0;j<M;j++) | |
| 13 | a[i][j]=rand()%10; | |
| 14 | for(i=0;i<N;i++) | |
| 15 | {for(j=0;j<M;j++)
| |
| 16 | cout<<a[i][j]<<" "; | |
| 17 | cout<<"\n ";} | |
| 18 | for(i=0;i<N;i++) | |
| 19 | {max=0;
| |
| 20 | for(j=0;j<M;j++) | |
| 21 | {max+=a[i][j];
| |
| 22 | if(max>k) | |
| 23 | max==k;} | |
| 24 | cout<<"\n"<<max<<" "<<k; | |
| 25 | } | |
| 26 | ||
| 27 | getch (); | |
| 28 | } |