?? 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 + -