#include "stdio.h"
void main(void)
{
int a, b, c;
int m;
printf("input a, b, c: ");
scanf("%d%d%d", &a, &b, &c);
m = a > b ? a : b;
m = m > c ? m : c;
printf("Max: %d\n", m);
}
if版:
#include "stdio.h"
void main(void)
{
int a, b, c;
int m;
printf("input a, b, c: ");
scanf("%d%d%d", &a, &b, &c);
if (a > b)
{
m = a;
}
else
{
m = b;
}
if (c > m)
{
m = c;
}
printf("Max: %d\n", m);
}
#include<stdio.h>
void main()
{
int a,b,c;
scanf("%d%d%d",&a,&b,&c);
printf("%d\n",(a>b?a:b)>c?(a>b?a:b):c);
}
#include <stdio.h>
#include <time.h>
#include <math.h>
#include <stdlib.h>
#define MAX(a,b) (((a)>(b))?a:b)
int main(void)
{
int num1,num2,num3,max;
printf("please entry a,b,c:");
scanf("%d %d %d\n",&num1,&num2,&num3);
getchar();
max = MAX(MAX(num1,num2),num3);
printf("Max = %d\n",max);
return 0;
}
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息