#16397: c++全if


sky710286 (我不是習近平)

School : 臺中市立東山高級中學
ID : 83553
IP address : [140.128.173.43]
Last Login :
2020-09-17 13:05:19
d984. 棄保效應 -- 板橋高中教學題 | From: [114.41.127.103] | Post Date : 2018-12-28 21:34

#include<iostream>
using namespace std;
int main(){
long long int a,b,c;
while(cin>>a>>b>>c){
if(a>=b&&b>=c&&a>b+c)
cout<<"A"<<endl;
else if(a>=b&&b>=c&&a<b+c)
cout<<"B"<<endl;
else if(a>=c&&c>=b&&a>c+b)
cout<<"A"<<endl;
else if(a>=c&&c>=b&&a<c+b)
cout<<"C"<<endl;
else if(b>=a&&a>=c&&b>a+c)
cout<<"B"<<endl;
else if(b>=a&&a>=c&&b<a+c)
cout<<"A"<<endl;
else if(b>=c&&c>=a&&b>c+a)
cout<<"B"<<endl;
else if(b>=c&&c>=a&&b<c+a)
cout<<"C"<<endl;
else if(c>=a&&a>=b&&c>a+b)
cout<<"C"<<endl;
else if(c>=a&&a>=b&&c<a+b)
cout<<"A"<<endl;
else if(c>=b&&b>=a&&c>b+a)
cout<<"C"<<endl;
else if(c>=b&&b>=a&&c<b+a)
cout<<"B"<<endl;
} return 0;
}

 
ZeroJudge Forum