168. 找錢的排列種類

 avatar
user_6817964
c_cpp
a year ago
350 B
3
Indexable
Never
extern int moneyPerm(int K);


int moneyPerm(int K) {
	if (K >= 10) {
		return moneyPerm(K - 1) + moneyPerm(K - 5) + moneyPerm(K - 10);
	}
	else if (K >= 5) {
		return moneyPerm(K - 1) + moneyPerm(K - 5);
	}
	else {
		return 1;
	}
}



int main() {
	int money;
	scanf("%d", &money);
	printf("%d", moneyPerm(money));
	return 0;
}