#include <stdio.h>
int eng_to_num(int letter) {
int count = 0;
count = count + letter / 10 + letter % 10 * 9;
return count;
}
int eva_letter(int total, int letter) {
if (letter < 18) {
//英文代號為A ~ H
total = eng_to_num(letter);
} else if (letter == 18) {
//英文代號為I,其代表34
letter = 34;
total = eng_to_num(letter);
} else if (letter > 18 && letter < 24) {
//英文代號為J ~ N(他們皆多位移一格)
letter -= 1;
total = eng_to_num(letter);
} else if (letter == 24) {
//英文代號為O,其代表35
letter = 35;
total = eng_to_num(letter);
} else if (letter > 24 && letter < 32) {
//英文代號為P ~ V(他們皆多位移兩格)
letter -= 2;
total = eng_to_num(letter);
} else if (letter == 32) {
//英文代號為W,其恰好代表32
total = eng_to_num(letter);
} else if (letter == 33 || letter == 34) {
//英文代號為X ~ Y(他們皆多位移三格)
letter -= 3;
total = eng_to_num(letter);
} else if (letter == 35) {
//英文代號為Z,其代表35
letter = 35;
total = eng_to_num(letter);
}
return total;
}
int main() {
int letter;
//將英文代號轉為數字
letter = letter + getchar() - 'A' + 10;
int total = 0;
total = eva_letter(total, letter);
for (int i = 8; i > 0; i--) {
total = total + (getchar() - 48) * i;
}
total = total + getchar() - 48;
if (total % 10 == 0) {
printf("real");
} else {
printf("fake");
}
return 0;
}
拜託各位教教我