The Biggest Water Proble
The Biggest Water Problem
https://www.nowcoder.com/practice/435aa556e093463891f6da7d322140a4?tpId=290&tqId=39938&sourceUrl=https%3A%2F%2Fwww.nowcoder.com%2Fexam%2Foj%3Ftab%3D%25E8%25AF%25AD%25E6%25B3%2595%25E7%25AF%2587%26topicId%3D290
#include <stdio.h> int main() { int num = 0; scanf("%d", &num); while (num >= 10) { int sum = 0; while (num) { // 将num的每一位上的数字进行相加 sum += (num % 10); num /= 10; } num = sum; } printf("%d", num); return 0; }