#include
using namespace std;
int buysuit()//买套装的函数
{
int n;
cout<<"please input the number of suit:"< cin>>n;
if(n>=50)
cout<<"you should pay:"<<(n*80)<<"yuan"< else if(n<50)
cout<<"you should pay:"<<(n*90)<<"yuan"< return 0;
};
int buyfrock()//买上衣的函数
{
int f;
cout<<"please input the number of frock:"< cin>>f;
cout<<"you hsould pay:"<<(f*60)<<"yuan"< return 0;
};
int buytrouser()//买裤子的函数
{
int t;
cout<<"please input the number of trouser:"< cin>>t;
cout<<"you should pay"<<(t*45)<<"yuan"< return 0;
};
void main()
{
char c;
cout<<"which will you choice:"< cout<<"if you choice suit please input s"< cout<<"if you choice frock please input f"< cout<<"if you choice trouser please input t"< cin>>c;
switch(c)
{
case's': buysuit();break;
case'f': buyfrock();break;
case't': buytrouser();break;
default:cout<<"error input!";break;
}
}
--------------------next---------------------
阅读(1017) | 评论(0) | 转发(0) |