#include <stdio.h>
#include <iostream>
#include <string.h>
enum { A = 10, B = 11, C = 12, D = 13, E = 14, F = 15, G = 16, H = 17,
I = 34, J = 18, K = 19, L = 20, M = 21, N = 22, O = 35, P = 23,
Q = 24, R = 25, S = 26, T = 27, U = 28, V = 29, W = 32, X = 30,
Y = 31, Z = 33
};
int main(){
int remain,check;
int place, b = 7;
int total = 0, total_2 = 0;
char num1[9];
int value[26] = { A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z };
char eng[27]={"ABCDEFGHIJKLMNOPQRSTUVWXYZ"};
scanf("%s",num1);
check = num1[8] - '0';
for( int i = 1 ; i < 9 ; i++ ) {
remain = num1[b] - '0';
total = total + remain * i ;
b--;
}
total_2 = total;
for( int j = 0 ; j < 26 ; j++ ) {
remain = value[j] % 10;
value[j] = value[j] / 10;
total_2 = total_2 + value[j] + remain * 9;
place = 10 - ( total_2 % 10 );
if( place == 10 )
place = 0;
if ( place == check )
printf("%c", eng[j] );
total_2 = total;
}
}
卡測資12跟19,超級問號,為什麼AMW那個的A會印不出來?但明明我在DEV C++中可以._.,有人可以解釋一下嗎?