a020.
身分證檢驗
| From: [140.130.208.27] |
發表日期
:
2013-01-06 23:47
#include<iostream>
using namespace std;
int main()
{
string num;
int yingwen[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(getline(cin,num))
{
int i=0;
i=(int)(yingwen[(num[0]-65)]/10)+9*(yingwen[num[0]-65]%10)+8*num[1]+7*num[2]+6*num[3]+5*num[4]+4*num[5]+3*num[6]+2*num[7]+num[8]+num[9];
if(i%10)
cout << "real\n";
else
cout <<"fake\n";
}
}