#21925: 同樣題目 每次執行結果不同


chinchia120 (Chin)

學校 : 新竹市立建功高級中學
編號 : 125336
來源 : [58.114.157.168]
最後登入時間 :
2023-12-27 20:09:14
a020. 身分證檢驗 | From: [42.73.186.251] | 發表日期 : 2020-07-31 10:54

#include <bits/stdc++.h>

using namespace std;

 

int main() {

char ch;

int a,b,c,d,e,f,g,h,i,j,k,sum;

while(cin>>ch>>a>>b>>c>>d>>e>>f>>g>>h>>i){

if(ch=='A')j=10;

else if(ch=='B')j=11;

else if(ch=='C')j=12;

else if(ch=='D')j=13;

else if(ch=='E')j=14;

else if(ch=='F')j=15;

else if(ch=='G')j=16;

else if(ch=='H')j=17;

else if(ch=='I')j=34;

else if(ch=='J')j=18;

else if(ch=='K')j=19;

else if(ch=='L')j=20;

else if(ch=='M')j=21;

else if(ch=='N')j=22;

else if(ch=='O')j=35;

else if(ch=='P')j=23;

else if(ch=='Q')j=24;

else if(ch=='R')j=25;

else if(ch=='S')j=26;

else if(ch=='T')j=27;

else if(ch=='U')j=28;

else if(ch=='V')j=29;

else if(ch=='W')j=32;

else if(ch=='X')j=30;

else if(ch=='Y')j=31;

else if(ch=='Z')j=33;

}

k=((j/10)+((j%10)*9));

sum=(k)+(8*a)+(7*b)+(6*c)+(5*d)+(4*e)+(3*f)+(2*g)+(1*h)+(i);

if(sum%10==0){

cout<<"real"<<endl;

}else{

cout<<"fake"<<endl;

}

return 0;

}

 
ZeroJudge Forum