55555555555555555TOT

P1089 [NOIP2004 提高组] 津津的储蓄计划

屑标题
by CEFqwq @ 2023-08-19 11:56:26


iii 没赋过值,怎么加一
by lowwarm @ 2023-08-19 12:01:47


@[chris731](/user/663164) btd,jbl
by 瀛洲仙子 @ 2023-08-19 12:01:47


根据题意模拟
by lowwarm @ 2023-08-19 12:05:21


```c #include <bits/stdc++.h> using namespace std; int main() { int y, s = 0, m, x; for (int i = 1; i <= 12; i++) { cin >> y; s = 300 - y + s; if (s < 0) { cout << -i; break; } if (s >= 100) { x = s % 100; m += s - x; s = x; } } if (s >= 0) cout << s + m * 1.2; return 0; } ```
by wzj0829 @ 2023-08-19 12:08:39


```#include<cstdio> using namespace std; int m=0,j=0,t,y;//j是津津手里的钱,m是存在妈妈里的钱 int main() { for(int i=1;i<=12;i++) { scjnf("%d",&y); t=j+300-y; j=t%100; m=m+t/100*100; if(t<0) { printf("-%d",i); return 0; } } printf("%.0lf",m*1.2+j); return 0; }
by Tanleyan @ 2023-08-19 17:16:20


谢谢 && 已关注
by chris731 @ 2023-08-20 09:37:35


|