Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma hdrstop
- #include <iostream.h>
- #include <conio.h>
- //---------------------------------------------------------------------------
- #pragma argsused
- void main()
- {const int N=5, M=5;
- int a[N][M],b[N],i,j,max,k=0;
- for(i=0;i<N;i++)
- for(j=0;j<M;j++)
- a[i][j]=rand()%10;
- for(i=0;i<N;i++)
- {for(j=0;j<M;j++)
- cout<<a[i][j]<<" ";
- cout<<"\n ";}
- for(i=0;i<N;i++)
- {max=0;
- for(j=0;j<M;j++)
- {max+=a[i][j];
- if(max>k)
- max==k;}
- cout<<"\n"<<max<<" "<<k;
- }
- getch ();
- }
Advertisement
Add Comment
Please, Sign In to add comment