|
|
вернуться в форумWhats wrong with this? var n,m,y:longint; x:longint; i,j,s:longint; b:boolean; mas:array[1..999] of longint;
begin read(n,m,y); x:=1; b:=false; for i:=0 to m-1 do begin for j:=1 to n do begin x:=x*i; end; if (x mod m) = y then begin s:=s+1; mas[s]:=i; b:=true; end; x:=1; end; if b then for i:=1 to s do write(mas[i],' ') else write(-1); readln;readln; end. Edited by author 07.02.2006 01:26 test for you 998 998 1 ANS 1 997 996 4 1 ANS 1 3 |
|
|