|
|
|
|
背景 Background |
|
|
为了for beginngers,特设此题,^_^
|
|
|
|
|
|
|
|
描述 Description |
|
|
数字接力
题目:
奶牛们在玩一个数字游戏,它们从一个整数开始,比如:6593。将这个整数中的各位数字全部取出,将他们相乘,得到一个新的整数,上面的例子就是6*5*9*3=810,然后继续做下去,8*1*0=0得到了一个个位数0。
帮助奶牛完成这个游戏,读入一个数并计算出有游戏得到一个个位数的过程。
输入格式 Input Format
一个整数N(10≤n≤2,000,000,000)
输出格式 Output Format
在单独的一行中按顺序输出游戏过程中产生的每一个数直到一个个位数结束。
样例输入
98886
样例输出
98886 27648 2688 768 336 54 20 0 |
|
|
|
|
|
|
|
输入格式 Input Format |
|
|
一个整数N(10≤n≤2,000,000,000)
|
|
|
|
|
|
|
|
输出格式 Output Format |
|
|
在单独的一行中按顺序输出游戏过程中产生的每一个数直到一个个位数结束。 |
|
|
|
|
|
|
|
时间限制 Time Limitation |
|
|
各个测试点1s
|
|
|
|
|
|
|
|
注释 Hint |
|
|
Free Pascal Code:
-------------------
program Plus;
var a,b:longint;
begin
readln(a,b);
writeln(a+b);
end.
C++ Code:
-------------------
#include <iostream>
using namespace std;
int main(){
int a,b;
cin>>a>>b;
cout<<a+b<<endl;
return 0;
}
|
|
|
|
|
|
|
|
|
Flag |
|
题号 |
P1287 |
|
模拟 |
通过 |
27人 |
提交 |
54次 |
通过率 |
50% |
难度 |
2 |
|
|
|
|
|
|