请帮我解决这个问题 [英] Please Help me on this Program
问题描述
编写将执行以下操作的程序;
要求用户输入FIVE DIGIT整数(从11111到99999)
将数字分成它的个别数字和
打印彼此相隔三位数的数字。
我无法找到解决方案!!!!!
Write a program that will do the following;
Ask user to enter a FIVE DIGIT integer (from 11111 to 99999)
Separate the number into its individual digits and
Print the digits separated from one another by three spaces each.
I caNNOT figure out the solution!!!!!
推荐答案
1111111111< eh *** @ hotmail.com>这样说:
1111111111 <eh***@hotmail.com> spoke thus:
要求用户输入一个FIVE DIGIT整数(从11111到99999)
将数字分成各自的数字和
打印分隔的数字彼此相隔三个空格。
我无法找到解决方案!!!!!
Ask user to enter a FIVE DIGIT integer (from 11111 to 99999)
Separate the number into its individual digits and
Print the digits separated from one another by three spaces each. I caNNOT figure out the solution!!!!!
如果您尝试过解决方案,请发布一些代码,您可能会
得到一些帮助。如果你没有,我希望你喜欢翻油腻
汉堡。
-
Christopher Benson-Manica |我*应该*知道我在说什么 - 如果我
ataru(at)cyberspace.org |不,我需要知道。火焰欢迎。
If you''ve attempted the solution, post some code and you''ll probably
get some help. If you haven''t, I hope you like flipping greasy
burgers.
--
Christopher Benson-Manica | I *should* know what I''m talking about - if I
ataru(at)cyberspace.org | don''t, I need to know. Flames welcome.
2004年5月11日11:55:53 -0700, eh ** *@hotmail.com (1111111111)写道:
On 11 May 2004 11:55:53 -0700, eh***@hotmail.com (1111111111) wrote:
编写一个程序,将执行以下操作;
要求用户输入五个数字整数(从11111到99999)
将数字分成各自的数字和
打印彼此相隔三位数的数字。
我无法找出解决方案! !!!!
Write a program that will do the following;
Ask user to enter a FIVE DIGIT integer (from 11111 to 99999)
Separate the number into its individual digits and
Print the digits separated from one another by three spaces each.
I caNNOT figure out the solution!!!!!
只比Christopher稍微慈善一点;-),这里有一些信息
来帮你跳-started:
获取int的组件数字的一种方法是使用整数/
和%运算符。注意任何数字n的最后一位数字可以通过表达式n%10获得
。如果你然后将n除以10并重复直到n是
零,你''会以相反的顺序生成数字的所有数字
(小心你如何处理零输入值)。
-leor
-
Leor Zolman --- BD软件--- www.bdsoft.com
C / C ++,Java,Perl和Unix的现场培训
C ++用户:下载BD软件'免费的STL错误消息解密器:
www.bdsoft.com /tools/stlfilt.html
Leor Zolman写道:
Leor Zolman wrote:
获取组件数字的一种方法int是通过使用整数/
One way to get the component digits of an int is via use of the integer /
或者你只需要一个字符串,确保字符是digi ts
并且需要它们的数量,然后完成其余部分。可能
对新手来说更容易吗?
Or you could just ask for a string, make sure that characters are digits
and there is required amount of them, and then do the rest of it. Might
be easier for a newbie?
这篇关于请帮我解决这个问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!