#include<stdio.h>intmain(){int a, b, c;scanf("%d %d %d",&a,&b,&c);if(a>b&&a>c)printf("最大值:%d\n", a);elseif(b>a&&b>c)printf("最大值:%d\n", b);elseprintf("最大值:%d\n", c);return0;}
三:
#include<stdio.h>intmax(int a,int b,int c){if(a > b && a > c)return a;elseif(b > a && b > c)return b;elsereturn c;}intmain(){int a, b, c;scanf("%d %d %d",&a,&b,&c);int result =max(a, b, c);printf("最大值:%d\n", result);return0;}
四:
#include<stdio.h>intmain(){int a, b, c,max=0;scanf("%d %d %d",&a,&b,&c);if(a > b)
max = a;else
max = b;if(c>max)printf("最大值:%d\n", c);elseprintf("最大值:%d\n", max);return0;}
五:
#include<stdio.h>intmain(){int a, b, c, max =0;scanf("%d %d %d",&a,&b,&c);
max = a > b ? a : b;
max = max > c ? max : c;printf("最大值:%d\n", max);return0;}