a020.
身分證檢驗
| From: [123.193.78.189] |
發表日期
:
2009-07-17 13:57
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{ int i,j;
char id[10];
char a[]={'A','B','C','D','E','F','G','H','J','K',
'L','M','N','P','Q','R','S','T','U','V','X','Y','W'
,'Z','I','O'};
while(scanf("%s",&id)!=EOF)
{
j=0;
for(i=0;i<26;i++)
{
if(id[0]==a[i]) j=((i+10)/10)+(i%10)*9+(id[9]-'0');
}
for(i=1;i<9;i++)
{
j+=(id[i]-48)*(9-i);
}
if(j%10==0)printf("real\n");
else printf("fake\n");
}
system("PAUSE");
return 0;
}