delete pics to save space
This commit is contained in:
23
history_source/ccf 入门篇/U4/4.4.6.cpp
Normal file
23
history_source/ccf 入门篇/U4/4.4.6.cpp
Normal file
@ -0,0 +1,23 @@
|
||||
#include<iostream>
|
||||
using namespace std;
|
||||
int main()
|
||||
{
|
||||
int a,b;
|
||||
while(true)
|
||||
{
|
||||
cin>>a;
|
||||
do
|
||||
{
|
||||
b=0;
|
||||
do
|
||||
{
|
||||
b=b+a%10;
|
||||
a/=10;
|
||||
}
|
||||
while(a>0);
|
||||
a=b;
|
||||
}
|
||||
while(a/10>0);
|
||||
cout<<a;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user