点击这里更换您喜欢的皮肤wtboj 首页
请点击这里登入noios   首页 入门 c++讲义 入门教程视频 金牌教程 入门视频 站务 公告 | 题库 记录 竞测 测试 闯关 作业 排名 团队 讨论 | 换肤 | 登入 注册  
News >>   新增功能:各团队管理员可以发布本团队作业了 ()

From sina007
数字接力
背景 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
  在单独的一行中按顺序输出游戏过程中产生的每一个数直到一个个位数结束。
样例输入 Sample Input
 
样例输出 Sample Output
 
时间限制 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
提交 讨论 题解
 Copyright wtboj © 2005-2006. www.wutuobang.date Powered by wtboj 关于 联系 帮助
 wtboj Information ---- Total Users : 1242 | Online Users / Processes : 0 / 59 | Processed Time : 77 ms | Server Time : 2025/4/27 2:41:38