描述
Recent children YangYang is training mathematical thinking, I am writing three numbers each time, let small YangYang say that which is the greatest number of those numbers.After a few training, small yangyang dizziness, now please you help him.
输入
The first line is an integer N represents the number of the test data set, the following N lines each including three numbers .
输出
The output includes N lines,each line has a number represents the greatest number of the test data set.
样例输入
2
1 2 3
100 200 300
1 2 3
100 200 300
样例输出
3
300
300
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<string.h>
double a[10];
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
// memset(a,0,sizeof(a));
for(int i=0;i<3;i++)
{
cin>>a[i];
}
sort(a,a+3);
cout<<a[2]<<endl;
}
return 0;
}
这道题一直提交都是不对的,都让我产生自我怀疑了,看了很久很久怎么都不知道错在哪里,最后问了别人才知道数据的类型错了,题目没说一定要是int型的数据也可以是小数,真是要吐血。