#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; }