pls help!
Послано
xantid 16 окт 2007 18:12
pls help!what's wrong with my program?
program j;
{$APPTYPE CONSOLE}
uses
SysUtils;
var i,n,n1,n2,n3,c1,c2,t,t1,t2,sum:longint;
s:string;
//a:array [1..1001] of longint;
begin
read(n1,c1);
read(n2,t,c2);
read(n3);
readln(n);
sum:=0;
for i:=1 to n do
begin
readln(s);
t1:=strtoint(copy(s,1,2));
t2:=strtoint(copy(s,4,2));
if (t1=0) and (t2<6) then sum:=sum+0 else
if (t2>0) then sum:=sum+t1+1 else sum:=sum+t1;
end;
writeln('Basic: ',n1+c1*sum);
if sum<=t then writeln('Combined: ',n2) else writeln('Combined: ',n2+(sum-t)*c2);
write('Unlimited: ',n3);
end.