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 编辑 ]