📄 1080.cpp
字号:
/* This Code is Submitted by wywcgs for Problem 1080 on 2005-03-05 at 18:32:08 */
#include <stdio.h>
int main()
{
int root, i, j, a[11];
while(1){
root = 0;
for(i = 0; i < 11; i++){
a[i] = 0;
}
while((a[0] = getchar()) != '\n'){
a[0] -= '0';
root += a[0];
if(root == 0){
return 0;
}
}
while(root >= 10){
for(i = 0; root >= 10; i++, root /= 10){
a[i] = root % 10;
}
for(j = 0; j < i; j++){
root += a[j];
}
}
printf("%ld\n", root);
}
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -