C语言实验——找中间数
Time Limit: 1000MS
Memory Limit: 65536KB
Problem Description
输入三个整数,找出其中的中间数。(这里的中间数指的是大小,不是位置。)
Input
输入3个整数。
Output
输出中间数。
Example Input
1 2 3
Example Output
2
Hint
Author
crq
参考代码
#include<stdio.h>
int main()
{
int a,b,c,temp;
scanf("%d%d%d",&a,&b,&c);
if(a>b)
{
temp = a;
a = b;
b = temp;
}
if(a>c)
{
temp = a;
a = c;
c = temp;
}
if(b>c)
{
temp = b;
b = c;
c = temp;
}
printf("%d",b);
return 0;
}