Advertisement
Guest User

divisors

a guest
Feb 19th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. var num1,num2,i,nond,nochd:longint;
  2. begin
  3. read(num1,num2);
  4. nond := 0;
  5. nochd := 0;
  6. for i := 1 to num1 do
  7. if (num1 mod i =0) and (i mod 2 = 0) and (num2 mod i = 0) then nochd := i;
  8. for i := 1 to num1 do
  9. if (num1 mod i =0) and (i mod 2 = 1) and (num2 mod i = 0) then nond := i;
  10. writeln(nochd,' ',nond);
  11. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement