Guest User

body of console pogram

a guest
Mar 12th, 2013
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.48 KB | None | 0 0
  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;
  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. }
Advertisement
Add Comment
Please, Sign In to add comment