c语言程序设计与设计呼呼

如何用c完成,输入俩个数,输出最大值,三种方法

#include<stdio.h>
int main(void)
{
int a,b;
printf("请两个输入数值,中间用空格隔开:");
scanf("%d%d",&a,&b);
if(a>b) {printf("最大值为%d\n",a);}
else {printf("最大值为%d\n",b);}
}
#include <stdio.h>

int max(int a, int b){
return a>=b ? a : b;
}

int main(){
int a, b;
scanf("%d%d", &a, &b);
printf("%d\n", max(a, b));
return 0;
}
只有两种方法

#include <stdio.h> 
main () 

    int a,b,c; 
    printf("Please input three integer nu:"); 
    scanf("%d %d %d",&a,&b,&c); 
    if(a<b) 
        if(b<c) 
            printf("max=%d\n",c); 
        else 
            printf("max=%d\n",b); 
    else 
        printf("max=%d\n",a); 
        return 0; 

example 2:

 

#include <stdio.h> 
int main() 

        int a, b, c; 
        int max; 
        printf("input three integer: "); 
        scanf("%d %d %d", &a, &b, &c); 
        max=a; 
        if (max<b) max=b; 
        if (max<c) max=c; 
 
                printf("max :%d",max);  
                return 0;