fork download
  1. #include <stdio.h>
  2. int main()
  3. {
  4. int count = 0;
  5. int a[9];
  6. for (int i = 0; i < 9; i++) {
  7. scanf("%d", &a[i]);
  8. }
  9. int max = a[0];
  10. for (int j = 1; j < 9; j++) {
  11. if (a[j] > max) {
  12. max = a[j];
  13. count = j + 1;
  14. }
  15. }
  16. printf("%d\n%d", max, count);
  17. return 0;
  18. }
Success #stdin #stdout 0s 4860KB
stdin
99
1
2
3
4
5
6
7
8
stdout
99
0