早教吧作业答案频道 -->其他-->
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,...的网友还看了以下:
列式计算1.卡车每小时行60千米,行45千米需多少小时?2.一根绳子用去3/4,刚好用去它的1/8 2020-04-25 …
甲乙两人共携带90千克行李乘火车,甲携带行李的超重部分应交5.6元的行李费,乙携带行李的超重部分应 2020-05-19 …
(2013•槐荫区一模)京沪高铁上运行的CRH380B型动车组(如图所示)采用4动4拖的编组方式, 2020-06-22 …
托运行李的费用计算方法是:托运行李总质量不超过30kg,每千克收费1元,超过30kg,超过的部分每 2020-06-27 …
按键精灵标记和循环的问题!第一段,只运行一次,我标记a第二段,要接着第一段,运行1次。第三段,接着 2020-07-13 …
1.有12吨煤,第一次运走1/4,第二次运走1/2吨,哪一次运得多?多多少吨?2.甲、乙两车同时从 2020-08-01 …
一道简单的数奥题甲.乙两人共携带90千克行李乘火车,甲携带行李的超重部分应交5.6元的行李费,乙携带 2020-12-14 …
京沪高铁上运行的CRH380B型动车组(如图所示)采用4动4拖的编组方式,最大运营行驶速度可达360 2020-12-15 …
四年级(1)班有16名同学参加队列表演,如果这16名同学排成4行,每行4人,最外圈同学穿黄色运动服, 2020-12-24 …
问道数学题怎么解1/X-7-1/X-6=1/X-5-1/X-4分式运算的连在一起的是整体,有用空格的 2021-01-23 …