当n=123114350时, 结果为:c1=3 c2=1 c3=2int c1, c2, c3;void fun(long n){ c1 = c2 = c3 = 0;while (n != 0) {switch (n % 10) {case 1: c1++; break; case 2:c2++;break; case 3: c3++;}n /= 10;}}不改变原来的,在主函数里输出打印~~~~谢谢啦
慕丝7291255
相关分类