SHARE
TWEET

Task C

a guest Apr 20th, 2019 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main(){
  6.     int ar[100][100];
  7.     int tot[100];
  8.     int n, m;
  9.     cin >> n >> m;
  10.     int maxind = 0;
  11.     for(int i = 0; i < n; i ++){
  12.         tot[i] = 0;
  13.         for(int j = 0; j < m; j ++){
  14.             cin >> a[i][j];
  15.             tot[i] += a[i][j];
  16.         }
  17.         if(tot[maxind] < tot[i])
  18.             maxind = i;
  19.     }
  20.     cout << tot[maxind] << endl;
  21.     cout << maxind;
  22. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top