标题:C语言while语句问题
取消只看楼主
我是含羞草
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2015-5-18
结帖率:60%
已结贴  问题点数:10 回复次数:0 
C语言while语句问题
用700元购入物品的程序,执行后得到


Line up;
1:notebook \150
2:mechanical pencil \180
3:highlight marker set \210
4:eraser \110
Now You have \700 now. What do you want?
Input number of items:1
You've got a notebook.
Now You have \550 now. What do you want?
Input number of items:2
You've got a mechanical pencil.
Now You have \370 now. What do you want?
Input number of items:3
You've got highlight marker set.
Now You have \160 now. What do you want?
Input number of items:4
You've got a eraser.

Total items : 4
Remaining money : 50





Line up;
1:notebook \150
2:mechanical pencil \180
3:highlight marker set \210
4:eraser \110
Now You have \700 now. What do you want?
Input number of items:0
Error! Choose number 1-4 .
Now You have \700 now. What do you want?
Input number of items:1
You've got a notebook.
Now You have \550 now. What do you want?
Input number of items:1
You've got a notebook.
Now You have \400 now. What do you want?
Input number of items:1
You've got a notebook.
Now You have \250 now. What do you want?
Input number of items:1
You've got a notebook.

Total items : 4
Remaining money : 100.

[ 本帖最后由 我是含羞草 于 2015-5-21 16:27 编辑 ]
搜索更多相关主题的帖子: C语言 number notebook mechanical 
2015-05-21 16:26



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-445577-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.283080 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved