文章
1
粉丝
67
获赞
0
访问
8.6k
#include <iostream>
#include <cstdio>
const int maxn = 1e9+10;
char ch[maxn];
using namespace std;
int solve(int n){
int tmp = n;
int res = 0;
while(tmp!=0)
{
res += tmp%10;
tmp /= 10;
}
return res;
}
int main()
{
string s;
while(cin>>s&&s!='0')
{
long long n = 0;
for(int i = 0; i < s[i]; i++)
{
n += s[i]-'0';
}
while(solve(n)>=10)
{
&n...
登录后发布评论
数组开太大了