|
|
вернуться в форумwa #8 What is in this test and what is wright answer? Re: wa #8 Послано sftuit 21 окт 2011 13:59 var n,m,y,i,x,j:longint; yes:boolean; begin read(n,m,y); yes:=false; for i:=0 to m-1 do begin x:=i; if (n=0)then x:= 1; for j:=2 to n do x:=(x*i) mod m; if x mod m=y then begin yes:=true; write(i,' '); end; end; if yes=false then write('-1'); end. |
|
|