实验六
来源:互联网 发布:全问号 乱码 java 编辑:程序博客网 时间:2024/05/07 23:34
LAP6_1
Menu:
A(dd)
D(elete)
S(ort)
Q(uit)
Select one:
要求用户提供相应的输入,并在用户输入A,D,S时分别提示“数据已经增加、删除、排序”,输入为Q时程序结束。
*/
#include<iostream>#include<conio.h>using namespace std;int main(){ cout<<"Menu:\n A(dd)\D(elete)\nS(ort)\nQ(uit)\nSelect one :"<<endl; char c; cin>>c; switch(c) { case 'A': case 'a': cout<<"The data has been added!"<<endl; break; case 'D': case 'd': cout<<"The data has been deleted!"<<endl; break; case 'S': case 's': cout<<"The data has been sorted!"<<endl; break; case 'Q': case 'q': exit(0); default: cout<<"Invalid choice! "<<endl; } return 0;}
LAP6_2
/*
批 发 商 零 售 商
数量(个) 单位价格(元/个) 数量(个) 单位价格(元/个)
50~200 10 1~20 18
200以上 8 20~40 15
40~50 12
*/
#include<iostream>#include<conio.h>using namespace std;int main(){ int num = 0; int sum = 0; cout<<"请输入你想购买的数量"<<endl; cin>>num; if(num <= 50) { if(num>40) { cout<<"这些数量只能算你零售,零售价为"<<ends<<12<<endl; sum = num * 12; } else if(num>20) { cout<<"这些数量只能算你零售,零售价为"<<ends<<15<<endl; sum = num * 15; } else if(num>0) { cout<<"这些数量只能算你零售,零售价为"<<ends<<18<<endl; sum = num * 18; } else cout<<"输入错误!!!\a"<<endl; } else if(num<200) { cout<<"这些数量可以算你批发价,批发价为"<<ends<<10<<endl; sum = num * 10; } else { cout<<"这些数量可以算你批发价,批发价为"<<ends<<8<<endl; sum = num * 8; } cout<<"您需要支付的总金额为:"<<ends<<sum<<endl; _getch(); return 0;}
- 实验六
- 实验六
- 实验六
- 实验六
- 实验六
- 实验六
- 实验六
- 实验六
- 【实验六】定时器中断实验
- 操作系统实验六实验报告
- 实验六答案
- 实验五、六
- 实验六encode_8_3
- 实验任务六
- VB实验六
- 操作系统实验六
- C++ 实验六
- C++ 实验六
- Linux 进程通信 内存映射技术
- 实验五
- 在老公眼里自己就是浑身充满谎言的人
- 共享内存的管理-注意信号SIGSEGV和SIGBUS(修改)
- textview cannot be resolved to a type 解决方法
- 实验六
- 爱因斯坦的思考题(手推)
- 【九個簡單實用的圖形圖像小軟件】
- 随记-工作,学习,生活
- 实验七
- Linux系统调用
- 计算机中的原码、反码和补码
- 实验八
- 301跳转和Rel=Canonica