#include<bits/stdc++.h>
using namespace std;
int main(){
	int n,s=0;
	cin>>n;
	while(n>=10){
		int w=n;
		while(w!=0){
			s+=w%10;
			w/=10;
		}
		n=s;
		s=0;
	}
	cout<<n;
	return 0;
}

0 条评论

目前还没有评论...

信息

ID
116
时间
1000ms
内存
256MiB
难度
8
标签
递交数
56
已通过
9
上传者