#include <iostream>
using namespace std;
int main()
{
string s;
int n=0;
int id[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};
while(1)
{
getline(cin,s);
int num=(int)s.at(0)-65;
int ans=0;
for(int i=1 ; i<9 ; i++)
{
int tran=(int)s.at(i);
ans+=(tran-48)*(9-i);
}
ans=ans+(id[num]/10)+(id[num]%10)*9+(int)s.at(9)-48;
if(ans%10==0)
{
cout<<"real"<<endl;
}
else if(ans%10!=0)
{
cout<<"fake"<<endl;
}
}
return 0;
}
有聽說是陣列超過範圍會RE,不過我找不到錯誤的地方
請各位賜教 謝謝