#19334: 想不到看這裡吧!


yp10870744 (Peter!!!)

School : 臺北市私立延平高級中學
ID : 104313
IP address : [203.72.178.252]
Last Login :
2020-01-09 17:01:40
d984. 棄保效應 -- 板橋高中教學題 | From: [203.72.178.252] | Post Date : 2019-09-25 16:50

#include <stdio.h>
#include <stdlib.h>

int main(){
int a,b,c;
long max,mid,min;
while(scanf("%d%d%d",&a,&b,&c)!=EOF){
if(a>b&&a>c){
max=a;
if(b>c){
mid=b;
min=c;
if(max>(mid+min)){
printf("A\n");
}else{
printf("B\n");
}
}else{
mid=c;
min=b;
if(max>(mid+min)){
printf("A\n");
}else{
printf("C\n");
}
}
}else if(b>a&&b>c){
max=b;
if(a>c){
mid=a;
min=c;
if(max>(mid+min)){
printf("B\n");
}else{
printf("A\n");
}
}else{
mid=c;
min=a;
if(max>(mid+min)){
printf("B\n");
}else{
printf("C\n");
}
}
}else{
max=c;
if(a>b){
mid=a;
min=b;
if(max>(mid+min)){
printf("C\n");
}else{
printf("A\n");
}
}else{
mid=b;
min=a;
if(max>(mid+min)){
printf("C\n");
}else{
printf("B\n");
}
}
}

}


return 0;
}

用C寫的

 
ZeroJudge Forum