Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var i,a,b,c,d,checker:integer;
- begin
- readln(a,b); //read 1st 2 nums
- readln(c,d); //read 2nd 2 nums
- for i:=10000 to 99999 do //iterate all 5-discharge nums
- if (i mod a=b)and (i mod c=d) then //if present num fits all condition demands then
- begin
- Write(i,' '); //write this num and space
- checker:=1; //checker is 1
- end;
- if checker=0 then //if checker is 0 then there arent any nums, demand to cinditions and
- writeln('-1'); //wrtie -1
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement