Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ticket 37 | task 2
- #include <iostream>
- #include <math.h>
- using namespace std;
- int main()
- {
- setlocale(LC_ALL, "Russian");
- int A[5][4];
- for (int i = 0; i < 5; i++)
- {
- for (int j = 0; j < 4; j++)
- {
- cout << A[i][j] << "\t";
- }
- cout << "\n";
- }
- int max = INT_MIN;
- int B[5] = {0};
- for (int i = 0; i < 5; i++)
- {
- for (int j = 0; j < 4; j++)
- {
- B[i] += A[i][j];
- }
- }
- for (int i = 0; i < 5; i++)
- {
- cout << B[i] << "\t";
- }
- for (int i = 0; i < 4; i++)
- {
- if (A[4][i] > max)
- {
- max = A[4][i];
- }
- }
- cout << "\n";
- cout << max;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement