Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <clocale>
- using namespace std;
- int const N = 5;
- int i, j, A[N][N];
- int f(int x[N][N]) {
- int max = 0;
- int qwe = 0;
- for (i = 0; i < N; i++) {
- if (max != 0) {
- cout << max << '\n';
- }
- max = 0;
- qwe = i;
- for (j = i; j < N; j++) {
- if (abs(A[qwe][j]) > max) {
- max = abs(A[qwe][j]);
- }
- }
- }
- return 0;
- }
- int main() {
- int max = 0;
- for (i = 0; i < N; i++) {
- cout << '\n';
- for (j = 0; j < N; j++) {
- A[i][j] = rand() % 100 - 50;
- cout << A[i][j] << ' ';
- }
- }
- cout << '\n';
- cout << '\n';
- for (i = 0; i < N; i++) {
- if (f(A) != 0){
- cout << f(A);
- }
- }
- cout << A[N - 1][N - 1];
- }
Advertisement
Add Comment
Please, Sign In to add comment