電費

 avatar
user_3763047219
c_cpp
2 years ago
364 B
1
Indexable
#include <stdio.h>
int main()
{
	int mon=0, ele=0,total=0;
	scanf("%d%d", &mon, &ele);
	if (mon >= 6 && mon <= 9) {
		if (ele > 120) {
			total=total+ele *(5+2);
		}
		else {
			total = total + ele * 5;
		}
	}
	else {
		if (ele > 120) {
			total = total + ele * (3 + 2);
		}
		else {
			total = total + ele * 3;
		}
	}
	printf("%d", total);
}
Editor is loading...