第 1 測資點(100%): WA (line:1)
答案不正確
您的答案為: AMW 正確答案為: FS
在dev上測試正確
可是上系統就是錯
看起來像是第一行輸出系統沒抓到然後就跳到下一行了?
#include<stdlib.h>
#include<iostream>
using namespace std;
int main() {
char City[26]={'A','B','C','D','E',
'F','G','H','I','J',
'K','L','M','N','O',
'P','Q','R','S','T',
'U','V','W','X','Y','Z'};
int iCity[26]={10,11,12,13,14,15,16,
17,34,18,19,20,21,22,
35,23,24,25,26,27,28,
29,32,30,31,33};
int iType;
while(cin>>iType) {
int temp[9], index=1, sum=0;
for(int i=0;i<9;i++) temp[i]=0;
for(int i=9;i>=0;i--) {
temp[i] = iType%10;
if(i<=8) {
sum+=temp[i]*index;
index++;
}
iType/=10;
}
for(int i=0;i<26;i++) {
if((iCity[i]%10*9 + iCity[i]/10 + sum + temp[9])%10 == 0) cout<<City[i];
}
cout<<endl;
}
}