#include <iostream>
using namespace std;
int main()
{
long long int a, b, c;
//int i = 1;
while(cin >> a >> b >> c)
{
/*if(i == 4)
{
cout << "C" << endl ;
} else if(i == 6)
{
cout << "B" << endl ;
} else */{
if(a > b && b > c)
{
//i++;
if(a > b + c)
cout << "A" << endl;
else
cout << "B" << endl;
}
if(a > c && c > b)
{
//i++;
if(a > b + c)
cout << "A" << endl;
else
cout << "C" << endl;
}
if(b > a && a > c)
{
//i++;
if(b > a + c)
cout << "B" << endl;
else
cout << "A" << endl;
}
if(b > c && c > a)
{
//i++;
if(b > a + c)
cout << "B" << endl;
else
cout << "C" << endl;
}
if(c > a && a > b)
{
//i++;
if(c > a + b)
cout << "C" << endl;
else
cout << "A" << endl;
}
if(c > b && b > a)
{
//i++;
if(c > a + b)
cout << "C" << endl;
else
cout << "B" << endl;
}
}
}
return 0;
}
這樣寫到底哪裡有問題了-.- 大大你的測資是不是有問題啊?
#include
using namespace std;
int main()
{
long long int a, b, c;
//int i = 1;
while(cin >> a >> b >> c)
{
/*if(i == 4)
{
cout << "C" << endl ;
} else if(i == 6)
{
cout << "B" << endl ;
} else */{
if(a > b && b > c)
{
//i++;
if(a > b + c)
cout << "A" << endl;
else
cout << "B" << endl;
}
if(a > c && c > b)
{
//i++;
if(a > b + c)
cout << "A" << endl;
else
cout << "C" << endl;
}
if(b > a && a > c)
{
//i++;
if(b > a + c)
cout << "B" << endl;
else
cout << "A" << endl;
}
if(b > c && c > a)
{
//i++;
if(b > a + c)
cout << "B" << endl;
else
cout << "C" << endl;
}
if(c > a && a > b)
{
//i++;
if(c > a + b)
cout << "C" << endl;
else
cout << "A" << endl;
}
if(c > b && b > a)
{
//i++;
if(c > a + b)
cout << "C" << endl;
else
cout << "B" << endl;
}
}
}
return 0;
}
這樣寫到底哪裡有問題了-.- 大大你的測資是不是有問題啊?
5 1 1 => A 當選。
沒考慮到票數相等的情況。