游客 Signup | Login
中文 | En

2442 - 【入门】求三个数的最大数0

已知有三个不等的数,将其中的最大数找出来。

Input

输入只有一行,包括3个整数。之间用一个空格分开。

Output

输出只有一行(这意味着末尾有一个回车符号),包括1个整数。

Examples

Input

1 5 8

Output

8

Solution C

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

Solution C++

#include <iostream>
using namespace std;

int max(int x,int y)
  {
    if(x<y)
      return y;
    else
      return x;
  }
int main()
{
  int a,b,c,z;
  cin>>a>>b>>c;
  z=max(max(a,b),c);
    cout<<z<<endl;
return 0;	  
}
Time Limit 1 second
Memory Limit 128 MB
Discuss Stats
上一题 下一题