题目描述
某公园门票的票价是每人50元,一次购票满30张,每张可以少收2元。试编写自动计费系统程序。
输入
输入一个正整数,表示购票的数量。
输出
输出一个整数,表示用户实际需要支付的金额。
样例输入 Copy
30
样例输出 Copy
1440
#include<stdio.h>
#include<math.h>
int main()
{
int n;//购票数量
scanf("%d",&n);
if(n<30)
{
printf("%d",n*50);
}
else
{
printf("%d",n*48);
}
return 0;
}