|
|
back to boardWhat's wrong? Posted by qxov 28 Apr 2005 17:59 #include <stdio.h> int main() { char number[100]; fscanf(stdin,"%*[^0-9]%[0-9]",number); int index, cf;
for(index=0, cf=0;number[index];index++) cf=(10*cf+(number[index]-'0')&0xff)%7; fprintf(stdout,"%d\n",cf); return 0; } |
|
|