Advertisement
semenrbt

макс корж контрольный

Nov 4th, 2020
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.54 KB | None | 0 0
  1. #include <iostream>
  2. #include <stdio.h>
  3. #define N 5
  4. #define M 5
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9.     int a[N][M] = {{1, 2, 3, 4, 5},
  10.                    {4, 16, 64, 128, 256},
  11.                    {0, 2, 5, 6, 7},
  12.                    {10, 11, 12, 13, 14},
  13.                    {101, 102, 103, 104, 105}};
  14.     int c;
  15.     cin >> c;
  16.     int i, j;
  17.     for(i = 0; i < N; i++){
  18.         for(j = 0; j < M; j++){
  19.             if(a[i][j] > c) j = M;
  20.             if(a[i][j] == c) printf("N = %d, M = %d\n", i+1,j+1);
  21.         }
  22.     }
  23.  
  24.     return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement