ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1576. Telephone Tariffs

pls help!
Posted by xantid 16 Oct 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.
Re: pls help!
Posted by And IV 17 Oct 2007 01:21
!!!!!!!!!!!!!!!!!!!!!
if (t1=0) and (t2<=6) then sum:=sum+0 else
!!!!!!!!!!!!!!!!!!!!!