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 1104. Don’t Ask Woman about Her Age

Help me, please. Why do i get Wrong answer?
Posted by Misha_W 4 Mar 2002 00:23
read the previous messages on the discussion board. if you still can't find what's your problem then post your program here
Posted by MadPsyentist/Sam 4 Mar 2002 02:00
>
Re: read the previous messages on the discussion board. if you still can't find what's your problem then post your program here
Posted by Misha_W 4 Mar 2002 16:42
var a:char;s:longint;max,i:byte;
begin
 s:=0;
 max:=0;
 read(a);
 repeat
 if a>'9' then begin
    s:=s+ord(a)-ord('7');
    if max<ord(a)-ord('7') then max:=ord(a)-ord('7');
 end
 else begin
   s:=s+ord(a)-ord('0');
   if max<ord(a)-ord('0') then max:=ord(a)-ord('0');
 end;
 read(a);
 until a=#13;
 i:=max;
 while (i<>0)and(i<=35)and(s mod i<>0) do
  inc(i);
 if i=0 then writeln('2')
 else if i<=35 then writeln(i+1)
 else writeln('No solution');
end.
Re: read the previous messages on the discussion board. if you still can't find what's your problem then post your program here
Posted by Misha_W 4 Mar 2002 17:14
Thank you! I have accsess. I wrote 'No solution', but need 'No
solution.'