You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
427 B

2 years ago
#include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
int sum = 0;
//努力尝试5瓶不行再尝试3瓶,一瓶10元
while (N >= 5 * 10) {
N -= 50;
sum += 7;
}
while (N >= 3 * 10) {
N -= 30;
sum += 4;
}
while (N >= 10) {
N -= 10;
sum++;
}
cout << sum << endl;
return 0;
}