题解 | 大水题
大水题
https://www.nowcoder.com/practice/6b9770de551c426287252421742f6ebf
#include <iostream>
using namespace std;
int Plus(int n){
int ans=0;
while(n){
ans+=(n%10);
n/=10;
}
return ans;
}
int main() {
int n;
cin>>n;
while(n>=10) n=Plus(n);
cout<<n;
return 0;
}
