int ucnvrf(char *); int ucnvrf(char *s) { int i, sum = 0; static char m[] = {2,4,8,5,10,9,7,3,6,11}; for (i = 0; i < 9; i++) sum += (*s++ - '0') * m[i]; sum %= m[i]; return sum % 10 - (*s - '0'); }