int addDigits(int num){
int temp = 0;
while (1){
temp += num%10;
num /= 10;
if (0 != num){
continue;
}
if (temp >= 10){
num = temp;
temp = 0;
}else{
break;
}
}
return temp;
}
258-简单-各数相加
猜你喜欢
转载自blog.csdn.net/lala0903/article/details/107761615
今日推荐
周排行