fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int n;
  6. cin >> n;
  7.  
  8. int a[100][100];
  9. for (int i = 0; i < n; i++) {
  10. for (int j = 0; j < n; j++) {
  11. cin >> a[i][j];
  12. }
  13. }
  14. int b = 0;
  15. for (int i = 0; i < n; i++) {
  16. int c = 0;
  17. for (int j = 0; j < n; j++) {
  18. c += a[i][j];
  19. }
  20. if (c > b) {
  21. b = c;
  22. }
  23. }
  24. cout << b << endl;
  25.  
  26. return 0;
  27. }
Success #stdin #stdout 0.01s 5348KB
stdin
2
1 1
2 2
stdout
4