'commit'
This commit is contained in:
23
TangDou/LuoGuBook/P1089.cpp
Normal file
23
TangDou/LuoGuBook/P1089.cpp
Normal file
@@ -0,0 +1,23 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int Left, save;
|
||||
|
||||
int main() {
|
||||
for (int i = 1; i <= 12; i++) {
|
||||
Left += 300;
|
||||
int x;
|
||||
cin >> x;
|
||||
Left = Left - x;
|
||||
if (Left < 0) {
|
||||
printf("-%d", i);
|
||||
exit(0);
|
||||
}
|
||||
int cnt = Left / 100;
|
||||
save += (100 * cnt);
|
||||
Left -= (100 * cnt);
|
||||
}
|
||||
printf("%d", (int)(1.2 * save) + Left);
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user