fork download
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. int h, w = 1, a, b, max = -1;
  6.  
  7. for (int i = 0;i < 9;i++)
  8. {
  9. scanf("%d", &a);
  10.  
  11. for (int j = 0;j < 8;j++)
  12. {
  13. scanf("%d", &b);
  14.  
  15. if (b > a)
  16. {
  17. a = b;
  18. if(b > max)
  19. {
  20. w = j + 2;
  21. }
  22. }
  23. }
  24. if (a > max)
  25. {
  26. max = a;
  27. h = i + 1;
  28. }
  29. }
  30.  
  31. printf("%d\n%d %d", max, h, w);
  32.  
  33. return 0;
  34. }
Success #stdin #stdout 0.01s 5288KB
stdin
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 1
2 0 0 0 0 0 0 0 0
stdout
2
9 9