Advertisement
Guest User

Untitled

a guest
Nov 18th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 0.45 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. #include <iomanip>
  4. #include <fstream>
  5. #include <string>
  6.  
  7. using namespace std;
  8.  
  9. int main(){
  10. int n,m,k;
  11. long long A[100][100];
  12. long long S[100]={0};
  13. long long max=-10000000;
  14. cin>>n>>m;
  15. for(int i=0;i<n;i++){
  16.   for(int j=0;j<m;j++){
  17.    cin>>A[i][j];
  18.   }
  19. }
  20. for(int i=0;i<n;i++){
  21.   for(int j=0;j<m;j++){
  22.     S[i]+=A[i][j];
  23.   }
  24.   if(S[i]>max){
  25.     k=i+1;
  26.     max=S[i];
  27.   }
  28. }
  29. cout<<k;
  30. return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement