Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main(){
- int ar[100][100];
- int tot[100];
- int n, m;
- cin >> n >> m;
- int maxind = 0;
- for(int i = 0; i < n; i ++){
- tot[i] = 0;
- for(int j = 0; j < m; j ++){
- cin >> a[i][j];
- tot[i] += a[i][j];
- }
- if(tot[maxind] < tot[i])
- maxind = i;
- }
- cout << tot[maxind] << endl;
- cout << maxind;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement