|
|
back to boardCommon BoardI've got WA on problem №1110. How can I attach this problem to title "задача" Here is my code. Please help to find mistake. #include <stdio.h> void main() { int x,n,m,y,p,i,s,u; vv: scanf("%d",&n); scanf("%d",&m); scanf("%d",&y); if (n<=0 || n>=999 || m<=1 || m>=999 || y<=0 || y>=99) goto vv; u=-1; s=0; x=0; while (x<=(m-1)) { p=1; for (i=1; i<=n; i++) { p=p*x; } if ((p % m) == y) { printf("%d ",x); s++; } x++; } if (s==0) printf("%d\t",u); } |
|
|