eolymp
bolt
Попробуйте наш новый интерфейс для отправки задач
Задачи

Строки с максимальной суммой

опубликовано 25.01.2023, 15:12:48

It is written "All numbers do not exceed 100 by absolute value". It must be 1000 !!!

опубликовано 10.01.2024, 17:51:01

include<bits/stdc++.h>

using namespace std; int main(){

long n,m; cin>>n>>m; long arr[n][m]; long maxx=-1001,cem=0; for(long i=0;i<n;i++){ for(long j=0;j<m;j++){ cin>>arr[i][j]; cem+=arr[i][j]; } if(cem>maxx){ maxx=cem; } cem=0; } long sum=0; for(long i=0;i<n;i++){ for(long j=0;j<m;j++){ sum+=arr[i][j]; } if(sum==maxx){ cout<<i+1<<" "; } sum=0; }

}