📄 ac.cpp
字号:
// 1013.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include <iostream>
#include <string>
using namespace std;
int main()
{
unsigned int i, v;
string s;
while (cin>>s && s!="0")
{
v = 0;
for (i = 0; i < s.length(); i++)
v += s[i] - '0';
while (v >= 10)
{
i = 0;
while (v > 0)
{
i += v % 10;
v = v / 10;
}
v = i;
}
cout<<v<<endl;
}
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -