题解 | #TheBiggestWaterProblem#
The Biggest Water Problem
https://www.nowcoder.com/practice/435aa556e093463891f6da7d322140a4
#include<stdio.h> int water(int n)//小递归,加油 { int k=0; int c=n; while(c) { k+=c%10; c/=10; } if(k>=10) { return water(k);//递归返回 } else return k; } int main() { int n; scanf("%d",&n); printf("%d",water(n)); return 0; }