fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int n, max=0, spot=0, i;
  5.  
  6. for (i = 0 ; i < 9 ; i++){
  7. scanf("%d", &n);
  8. if(max < n){
  9. max = n;
  10. spot = i;
  11. }
  12. }
  13.  
  14. printf("%d\n%d",max, spot);
  15. return 0;
  16. }
  17.  
Success #stdin #stdout 0.01s 5280KB
stdin
3
29
38
12
57
74
40
85
61
stdout
85
7