a020.
身分證檢驗
| From: [36.226.33.175] |
發表日期
:
2014-09-11 20:41
#include <iostream>
using namespace std;
int main(void) {
int first[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};
char input[10];
while(cin>>input){
int sum=first[input[0]-65]/10+first[input[0]-65]%10*9+input[9]-48;
for(int i=1;i<=8;i++)sum+=(input[i]-48)*(9-i);
cout<<((sum%10)?"fake":"real")<<endl;
}
}