描述
为了避免浪费,政府决定制定新的水费政策。如果月用水量不超过10吨则按每吨6元计算,大于10吨不超过20吨的部分则按每吨7元计算,超过20吨的部分则按每吨10元计算。
输入
输入月用水量
输出
输出水费
输入样例 1
9
输出样例 1
54
#include<stdio.h>
#include<math.h>
int main()
{
int n;
scanf("%d",&n);
if(n<=10)
printf("%d",6*n);
else if(n>10&&n<=20)
printf("%d",60+(n-10)*7);
else
printf("%d",130+(n-20)*10);
return 0;
}