//模拟ATM机
#include<stdio.h>
main()
{
printf("=============================="
" | Please select key: |"
" | 1.Quary |"
" | 2.Credit |"
" | 3.Debit |"
" | 4.Return |"
" ==============================="
);
int i,j,k;
scanf("%d",&i);
switch(i)
case 1:
printf(
"======================="
" | your balance is$1000. |"
" | Press any key to return... |"
" | |"
" ======================="
);
case 2:
printf(
"========================="
" |Please select Credit money: |"
" | 1.$50 |"
" | 2.$100 |"
" | 3.return |"
" ========================= "
);
scanf("%d",&j);
switch(j)
{
case 1:
printf(" your Credit money is $50,thank you !"
"Press any key to retuen...");break
case 2:
printf(" your Credit money is $100,thank you !"
"Press any key to retuen...");break
case 3:
printf("thank you for your using !"
"good bye");break
}
case 3:
printf("Please select debit money:"
"1.$50"
"2.$100"
"3.$500"
"4.$1000"
"5.return"
);
scanf("%d",&k);
switch(k)
{
case 1:
printf("your debit money is $50,thank you"
"Press any key to return");break
case 2:
printf("your debit money is $100,thank you"
"Press any key to return");break
case 3:
printf("your debit money is $500,thank you"
"Press any key to return");break
case 4:
printf("your debit money is $1000,thank you"
"Press any key to return");break
case 5:
printf("thank you for your using !"
"good bye");break
}
}
暗域天堂
暗域天堂
相关分类