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

Common Board

Problem 1139. Please look my code!!!!!!
Posted by Vitaliy Surovyi 10 Aug 2003 19:05
Var
   N,M,Ost,NSD,Bil,Men : Longint;
Begin
Read(N);Read(M);
Bil:=N;Men:=M;
While Bil Mod Men <>0 Do Begin
Ost:=Bil Mod Men;
Bil:=Men;
Men:=Ost;
End;
NSD:=Men;
Writeln(N+M-NSD);
End.
Re: Problem 1139. Please look my code!!!!!!
Posted by GodZilla 10 Aug 2003 19:09
Try this :

if men>bil then men:=men mod bil else bil:=bil mod men;

And this (men=0)or(bil=0)

NSD:=men+bil

Good Luck !!!
Re: Problem 1139. Please look my code!!!!!!
Posted by Vitaliy Surovyi 10 Aug 2003 21:22
Unfortunataly this doesn't work. Still WA.
Re: Problem 1139. Please look my code!!!!!!
Posted by GodZilla 11 Aug 2003 18:15
You can mail me VRomanchik@tut.by

And i send my AC