请求大佬帮忙看看错的原因
不懂错的原因,大佬帮忙看看,就一点
#include <stdio.h> int main( void ) { unsigned n; scanf( "%u", &n ); unsigned sum = 0; for( unsigned t=n; t; t/=10 ) sum += t%10; unsigned mask = 1; for( unsigned t=sum; t>=10; t/=10 ) mask *= 10; const char* map[] = { "ling","yi","er","san","si","wu","liu","qi","ba","jiu" }; for( unsigned t=mask; t; t/=10 ) { unsigned index = sum/t%10; printf( "%s%c", map[index], " \n"[t==1] ); } return 0; }
[此贴子已经被作者于2019-11-13 10:41编辑过]