先說 題目有說明不討論同票數情況
#include<iostream>
using namespace std;
int main(){
int a,b,c,t = 0;
while(cin>>a){
cin>>b; cin>>c;
if(a > b){
if(b > c){
b = b+c;
if(a > b){
cout<<"A\n";
}else{
cout<<"B\n";}
}
if(c > a){
a = a+b;
if(c > a){
cout<<"C\n";
}else{
cout<<"A\n";}
}
}else if(b > a){
if(a > c){
a = a+c;
if(b > a){
cout<<"B\n";
}else{
cout<<"A\n";}
}
if(c > b){
b = b+a;
if(c > b){
cout<<"C\n";
}else{
cout<<"B\n";}
}
}
}
return 0;
}
已經用最簡單的方式了還是過不了 ?