Advertisement
Korobka887

6-2

May 12th, 2023 (edited)
940
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.50 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main() {
  4.     double a[3][6], sum;
  5.     double max = -1.7e+308;
  6.    
  7.     for (int i = 0; i < 3; ++i) {
  8.         for (int j = 0; j < 6; ++j) {
  9.             scanf("%lf", &a[i][j]);
  10.             max = a[i][j] > max ? a[i][j] : max;
  11.         }
  12.     }
  13.    
  14.     for (int i = 0; i < 3; ++i) {
  15.         for (int j = 0; j < 6; ++j) {
  16.             if (a[i][j] == max) {
  17.                 sum = i + j + 2;
  18.             }
  19.         }
  20.     }
  21.    
  22.     printf("%lf", sum);
  23.  
  24.     return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement