题解 | The Biggest Water Problem
The Biggest Water Problem
https://www.nowcoder.com/practice/435aa556e093463891f6da7d322140a4
#include <stdio.h> int out(int n) { int g=0; while(n) { g+=n%10; n/=10; } if(g>9) { return out(g); } else return g; } int main() { int n; scanf("%d",&n); printf("%d",out(n)); return 0; }