a020.
身分證檢驗
| From: [120.115.4.12] |
發表日期
:
2013-05-29 00:03
#include <stdio.h>
#include <stdlib.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char *argv[]) {
int a,b,i;
char x[10]={'\0'};
int g[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(scanf("%s,x")!=EOF)
{a=0;
for(i=1;i<10;i++)
{
a=a+(x[i]-48)*(9-i);
}
b=x[0]-65;
a=a+g[b]/10+(g[b]%10)*9;
a=a+(x[9]-48)*9;
if(a%10==0)
printf("real\n");
else
printf("fake\n");
}
return 0;
}