c7-5-3.c 436 B

123456789101112131415161718192021
  1. #include <stdio.h>
  2. void main()
  3. { int max4(int a,int b,int c,int d);
  4. int a,b,c,d,max;
  5. printf("Please enter 4 interger numbers:");
  6. scanf("%d %d %d %d",&a,&b,&c,&d);
  7. max=max4(a,b,c,d);
  8. printf("max=%d \n",max);
  9. }
  10. int max4(int a,int b,int c,int d)
  11. { int max2(int a,int b);
  12. int m;
  13. m=max2(max2(max2(a,b),c),d); /* ×Ðϸ·ÖÎö´ËÐÐ */
  14. return(m);
  15. }
  16. int max2(int a,int b)
  17. {
  18. return(a>b?a:b);
  19. }