/*
* Copyright (c) 2014, 烟台大学计算机学院
* All rights reserved.
* 作 者:王颖
* 完成日期:2014 年 2 月 17 日
* 版 本 号:v1.0
* 输入描述: 无
* 问题描述:某航空公司规定:在旅游旺季7─9月份,若订票超过20张,优惠票价的15%,20张以下,优惠5%;
* 在旅游淡季1─5月、10月、11月份订票超过20张,优惠30%,20张以下,优惠20%;其余月份不优惠。
* 请编程序能根据月份和旅客订票张数决定优惠率。
* 程序输出:略
* 问题分析:略
* 算法设计:略
*/
#include <iostream>
using namespace std;
void privilege(int month,int tickets);
int main()
{
int month;
int tickets;
cin>>month>>tickets;
privilege(month,tickets);
return 0;
}
void privilege(int month,int tickets)
{
if ((month>=7)&&(month<=9))
{
if (tickets<20)
{
cout<<"优惠5%";
}
else
{
cout<<"优惠15%";
}
}
else if (((month>=1)&&(month<=5))||(month==10)||(month==11))
{
if (tickets<20)
{
cout<<"优惠20%";
}
else
{
cout<<"优惠30%";
}
}
else
{
cout<<"不优惠";
}
}