Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var num1,num2,i,nond,nochd:longint;
- begin
- read(num1,num2);
- nond := 0;
- nochd := 0;
- for i := 1 to num1 do
- if (num1 mod i =0) and (i mod 2 = 0) and (num2 mod i = 0) then nochd := i;
- for i := 1 to num1 do
- if (num1 mod i =0) and (i mod 2 = 1) and (num2 mod i = 0) then nond := i;
- writeln(nochd,' ',nond);
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement