游客 Signup | Login
中文 | En

1146 - C语言5.8

输入三个整数,比较三个数的大小。输出最大的值。

Input

三个整数,用空格分隔。

Output

请输出读入的三个整数的最大值。

请注意行尾输出换行。

Examples

Input

8 5 20

Output

20

Solution C

#include<stdio.h>
int main(){
int a,b,c,max;
scanf("%d%d%d",&a,&b,&c);
max=a;
if(max<b)
  max=b;
else if(max<c)
  max=c;
printf("%d\n",max);
return 0;
}

Solution C++

#include <stdio.h>
int main() {
	int max(int x, int y);
	int a, b, c, d;
	scanf("%d %d %d", &a, &b, &c);
	d = max(max(a, b), c);
	printf("%d\n", d);
	return 0;
}
int max(int x, int y) {
	int z;
	if (x > y) z = x;
	else z = y;
	return z;
}

Time Limit 1 second
Memory Limit 32 MB
Discuss Stats
上一题 下一题