while循环使用递减计数器 [英] while loop with a decrementing counter

查看:249
本文介绍了while循环使用递减计数器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨所有

我有一个我的计数器,它以一个值开始,然后通过循环的每个步骤它应该下降一个。确定我运行此程序时的试用数据,并检查并重新检查以确保测试数据具有预期值


i = 3

revline [0] = a

[1] = s

[2] = d

[3] = f

hi all
i have a with my counter that starts at a value then for each step through the loop it should go down by one. ok the trial data i have when i run this program, and i have checked and rechecked it to make sure that the test data has the expected values

i=3
revline[0]=a
[1]=s
[2]=d
[3]=f

展开 | 选择 | Wrap | 行号

推荐答案


hi all

i有一个我的计数器,它以一个值开始,然后通过循环的每个步骤它应该下降一个。确定我运行此程序时的试用数据,并检查并重新检查以确保测试数据具有预期值


i = 3

revline [0] = a

[1] = s

[2] = d

[3] = f
hi all
i have a with my counter that starts at a value then for each step through the loop it should go down by one. ok the trial data i have when i run this program, and i have checked and rechecked it to make sure that the test data has the expected values

i=3
revline[0]=a
[1]=s
[2]=d
[3]=f
展开 | 选择 | Wrap | 行号


Nepomuk是对的!


只需创建一个字符数组然后存储所有的字符

用户输入的字符串。然后唯一剩下的就是在屏幕上打印数组,但从最后一个位置开始。

你将从很多打字中拯救自己:-) ))


干杯
Nepomuk is right!

Just create an array of chars and then store in it all the chars
of the string that the user enters. Then the only thing left is to print
the array on the screen but starting from the last position.
You ''ll save yourself from a lot of typing :-)))

Cheers



只需创建一个字符数组,然后将其存储在其中字符

用户输入的字符串。
Just create an array of chars and then store in it all the chars
of the string that the user enters.



阅读 String API 找到方法,这对于完成这项工作非常有用。


问候,

Nepomuk

Read the String API to find methods, that will be very useful doing that job.

Greetings,
Nepomuk


这篇关于while循环使用递减计数器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆