|
|
вернуться в форумHelp me, please. Why do i get Wrong answer? read the previous messages on the discussion board. if you still can't find what's your problem then post your program here > Re: read the previous messages on the discussion board. if you still can't find what's your problem then post your program here 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 Thank you! I have accsess. I wrote 'No solution', but need 'No solution.' |
|
|