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 1567. SMS-spam

HELP me please, what's wrong? 1st test is right but in 2 i have WA...
Posted by green_smile 22 Oct 2011 19:01
program z1567;
var s:char;
sum:integer;
begin
while not eof do begin
 read(s);
 if (s='a') then sum:= sum+1;
 if (s='b') then sum:= sum+2;
 if (s='c') then sum:= sum+3;
 if (s='d') then sum:= sum+1;
 if (s='e') then sum:= sum+2;
 if (s='f') then sum:= sum+3;
 if (s='g') then sum:= sum+1;
 if (s='h') then sum:= sum+2;
 if (s='i') then sum:= sum+3;
 if (s='j') then sum:= sum+1;
 if (s='k') then sum:= sum+2;
 if (s='l') then sum:= sum+3;
 if (s='m') then sum:= sum+1;
 if (s='n') then sum:= sum+2;
 if (s='o') then sum:= sum+3;
 if (s='p') then sum:= sum+1;
 if (s='q') then sum:= sum+2;
 if (s='r') then sum:= sum+3;
 if (s='s') then sum:= sum+1;
 if (s='t') then sum:= sum+2;
 if (s='u') then sum:= sum+3;
 if (s='v') then sum:= sum+1;
 if (s='w') then sum:= sum+2;
 if (s='x') then sum:= sum+3;
 if (s='w') then sum:= sum+1;
 if (s='z') then sum:= sum+2;
 if (s='.') then sum:= sum+1;
 if (s=',') then sum:= sum+2;
 if (s='!') then sum:= sum+3;
 if (s=' ') then sum:= sum+1;  end;
write(sum);
end.