fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. // your code goes here
  5. int a,b,c,d,max;
  6. scanf("%d,%d,%d,%d",&a,&b,&c,&d);
  7. if(a>=b&&a>=c&&a>=d)max=a;
  8. if(b>=a&&b>=c&&b>=d)max=b;
  9. if(c>=a&&c>=b&&c>=d)max=c;
  10. if(d>=a&&d>=b&&d>=c)max=d;
  11. printf("最大值=%d\n",max);
  12. return 0;
  13. }
  14.  
Success #stdin #stdout 0.01s 5320KB
stdin
3,8,9,6
stdout
最大值=9