- 津津的储蓄计划
- 2009-10-25 20:34:16 @
试了N次都只有40分原因是超时...谁能看下谢谢
#include
using namespace std;
int main(){
int a=0,b=0;
int d=0;
int c=0;
int i=0;
for(i=1;i>a;
if(b
2 条评论
-
799154798 LV 5 @ 2009-10-26 07:56:36
不对不对
-
2009-10-26 07:50:24@
var
s:array[1..12] of integer;
i,t,q,xian:integer;
cun:real;
begin
xian:=0;
cun:=0;
for i:=1 to 12 do
begin
read(s[i]);
xian:=xian+300;
if (xian-s[i]) < 0
then
begin
writeln('-',i);
exit;
end;
if xian > s[i]
then
q:=(xian-s[i]) div 100
else
q:=0;
cun:=cun+q*100;
xian:=xian-s[i]-q*100;
end;
cun:=cun*1.2+xian;
writeln(cun:0:0);
end.
- 1