Problem ID :a039. 公平的戰役(EOF版)

New Thread

User 想問一下這樣寫哪裡有問題 系統顯示SE 謝謝

JimmyChen SendIMessage
JimmyChen

a039. 公平的戰役(EOF版) | From: 1.171.201.189 | Post Date:2020-02-24 20:56:41.0

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

/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char *argv[]) {
int a,b;
scanf("%d %d",&a,&b);
while(1){
if(feof(stdin)){
break;
}
else if(a<b){
printf("B %d",b-a);
scanf("%d %d",&a,&b);
}
else if(a==b){
printf("0");
}
else if(a>b){
printf("A %d",a-b);
scanf("%d %d",&a,&b);
}
}
return 0;
}
 


文章類型: 一般 | Reply | Back

New Thread

ZeroJudge Forum