早教吧作业答案频道 -->其他-->
ZOJ1489运行正确,WA,应该是求最小X地方错了,真心求改正ZOJProblemSet-14892^xmodn=1--------------------------------------------------------------------------------TimeLimit:1SecondMemoryLimit:32768KB---------------------
题目详情
ZOJ 1489 运行正确,WA,应该是求最小X地方错了,真心求改正
ZOJ Problem Set - 14892^x mod n = 1
--------------------------------------------------------------------------------
Time Limit:1 Second Memory Limit:32768 KB
--------------------------------------------------------------------------------
Give a number n,find the minimum x that satisfies 2^x mod n = 1.
Input
One positive integer on each line,the value of n.
Output
If the minimum x exists,print a line with 2^x mod n = 1.
Print 2^?mod n = 1 otherwise.
You should replace x and n with specific numbers.
Sample Input
2
5
Sample Output
2^?mod 2 = 1
2^4 mod 5 = 1
-------------------------------------------------------------------------------------------
#include
#include
int main()
{
int n,x,i,count,a;
scanf("%d",&n);
if(n%2==1)
{
a=1;
for(x=1;x
ZOJ Problem Set - 14892^x mod n = 1
--------------------------------------------------------------------------------
Time Limit:1 Second Memory Limit:32768 KB
--------------------------------------------------------------------------------
Give a number n,find the minimum x that satisfies 2^x mod n = 1.
Input
One positive integer on each line,the value of n.
Output
If the minimum x exists,print a line with 2^x mod n = 1.
Print 2^?mod n = 1 otherwise.
You should replace x and n with specific numbers.
Sample Input
2
5
Sample Output
2^?mod 2 = 1
2^4 mod 5 = 1
-------------------------------------------------------------------------------------------
#include
#include
int main()
{
int n,x,i,count,a;
scanf("%d",&n);
if(n%2==1)
{
a=1;
for(x=1;x
▼优质解答
答案和解析
#include
#include
int main()
{
int n,x,i,count,a;
while(scanf("%d",&n)==1) // 多组输入
{
count=0; // 初始化count
if(n%2==1)
{
a=1;
for(x=1;x
#include
int main()
{
int n,x,i,count,a;
while(scanf("%d",&n)==1) // 多组输入
{
count=0; // 初始化count
if(n%2==1)
{
a=1;
for(x=1;x
看了ZOJ1489运行正确,WA,...的网友还看了以下:
(2006•宁波)已知⊙O过点D(4,3),点H与点D关于y轴对称,过H作⊙O的切线交y轴于点A( 2020-05-13 …
已知:如图,在直角坐标系中,直角三角形OAB,O为坐标原点,AB=1,OB=3,将△OAB绕着A点 2020-05-13 …
如图,在棱长为a的正方体oabc-o'a'b'c'中,E,F分别是棱AB,BC上的动点,且AE=B 2020-05-16 …
如图所示,ABCD是菱形,对角线AC与BD相交于点O,角ACD=30°,BD=6.(1)求证:三角 2020-05-16 …
数学圆几何题PA和PB分别与O相切于A,B两点,做直径AC,并延长PB于点D,连接OP,CB,若P 2020-05-23 …
如图,正三角形ABC的边长6√3cm,⊙O的半径为rcm,圆心O从A点出发,沿着线路AB(1)若r 2020-06-07 …
(2000•江西)如图,已知O是正方形ABCD对角线AC上一点,以O为圆心、OA的长为半径的⊙O与 2020-07-20 …
1圆O的半径为R求圆O的内接正方形,圆O的外切正方形的边长比AB;AB'和面积比S内;S外2圆O的 2020-07-29 …
如图,O为正方形ABCD对角线上一点,以O为圆心,OA长为半径的⊙O与BC相切于点M.(1)求证: 2020-07-30 …
正方形ABCD边长为2,内切圆为圆O,点P是圆O上任意一点,1.求丨向量PA+向量PB+向量PC+ 2020-07-31 …