Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- ifstream fin("graf.in");
- int n, a[51][51], gr[51];
- int main() {
- fin >> n;
- for (int i = 1; i <= n; i++) {
- for (int j = 1; j <= n; j++) {
- fin >> a[i][j];
- }
- }
- int maxi = 0;
- for (int i = 1; i <= n; i++) {
- int sum = 0;
- for (int j = 1; j <= n; j++) {
- sum += a[i][j];
- }
- if (sum > maxi) {
- maxi = sum;
- }
- }
- cout << maxi << endl;
- return 0;
- }
Add Comment
Please, Sign In to add comment