CSP-201709-1-打酱油 完整代码 #include<iostream> using namespace std; int main() { int N, num = 0; cin >> N; int n1 = N / 50; if (n1 != 0) { N = N - n1 * 50; num += n1 * 7; } int n2 = N / 30; if (n2 != 0) { N = N - n2 * 30; num += n2 * 4; } int n3 = N / 10; num += n3; cout << num; return 0; }