30 lines
451 B
C
30 lines
451 B
C
#include <stdio.h>
|
|
int main(void)
|
|
{
|
|
int a,b,c,t;
|
|
printf("Please input 3 integer numbers:\n");
|
|
scanf("%d%d%d",&a,&b,&c);
|
|
while (a>b>c)
|
|
{
|
|
if (a<b)
|
|
{
|
|
t=a;
|
|
a=b;
|
|
b=t;
|
|
}
|
|
else if (b<c)
|
|
{
|
|
t=b;
|
|
b=c;
|
|
c=t;
|
|
}
|
|
else if (a<c)
|
|
{
|
|
t=a;
|
|
a=c;
|
|
c=t;
|
|
}
|
|
}
|
|
printf("%d is the maximum.",a);
|
|
return 0;
|
|
} |