We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5a99a99 commit 7c3954eCopy full SHA for 7c3954e
lg1089/main.cpp
@@ -6,14 +6,32 @@
6
using namespace std;
7
8
int red[13];
9
-
+int inhand=0;
10
+int now=0;
11
int main(){
12
13
for(int i=1;i<=12;i++){
14
scanf("%d",&red[i]);
15
+ now+=300;
16
+
17
+ if((now-red[i])>=100){
18
19
20
+ //cout<<"*"<<now<<endl;
21
+ inhand+=((now-red[i])/100)*100;
22
+ }else{
23
+ if((now-red[i])<0){
24
+ cout<<"-"<<i;
25
+ return 0;
26
+ }
27
28
29
+ now=(now-red[i])%100;
30
};
31
32
33
+ printf("%.0f",now+inhand*(1.2));
34
35
36
return 0;
37
}
lg1089/main.exe
1.91 MB
0 commit comments