c#console app- while命令 - 如何限制循环次数? [英] c# console app- while command- How to limit the number of loops?
本文介绍了c#console app- while命令 - 如何限制循环次数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在开发一个有趣的程序,我正在使用'while'命令。我想问一下 - 我需要编写什么来限制使用我的程序的人的循环次数?例如 - 我问:"5 + 2的价值是多少?"和
他错了几次,所以我怎么限制他的'尝试'的数量,直到他写7? div class ="h2_lin">解决方案
第一个学校课堂作业问题。设置一个开关并在每次使用++运算符时使用。
I'm working on a program for fun and I'm using the 'while' command. I want to ask- What do I need to write to limit the number of loops that the person who's using my program would have? For example- I ask: "What is the value of 5+2?", and he's wrong a few times, so how do I limit the number of 'tries' he has until he writes 7?
解决方案
First school class homework question. Set a switch and use everytime the ++ operator.
这篇关于c#console app- while命令 - 如何限制循环次数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文