Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Java SE 综合讨论区 » 编程/算法/API  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
话题锁定
该话题已被锁定 - why , 2006-01-05 20:30
如果您尚不清楚该话题被锁定的原因,请参考论坛规则以及本版公告或者联系本版版主。
作者 一个算术题,是求什么的?请教
xndd





发贴: 10
积分: 0
于 2005-11-27 22:33 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
public class test2 {
  public static void main(String[] args)
  {
    int num;
    int i;

    for(i=1;i<=1000;i++)
    {
      num = i;
      if(num%3==2 && num%5==3 && num%7==2)
        System.out.println(num+"是素数");

    }
  }
  
}

就是除3余2,除5余3,除7余2的这个,到底是不是素数?我感觉不是啊



作者 Re:一个算术题,是求什么的?请教 [Re:xndd]
yan_1203





发贴: 17
积分: 0
于 2005-11-27 22:56 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
这个不是求素数,只是求满足这三项的数而已.


作者 Re:一个算术题,是求什么的?请教 [Re:xndd]
andony756





发贴: 21
积分: 1
于 2005-11-27 23:11 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
这个指定不是求素数的


作者 Re:一个算术题,是求什么的?请教 [Re:xndd]
why

問題兒童

总版主


发贴: 4629
积分: 388
于 2005-11-28 00:00 user profilesend a private message to usersend email to whysearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
Dead感觉不是
Dead
这个也靠感觉Question

唉......



作者 Re:一个算术题,是求什么的?请教 [Re:xndd]
andony756





发贴: 21
积分: 1
于 2005-11-28 21:44 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
要想知道是不是素数
那我把运行结果给你看一下,答案也就出来了
23是素数

128是素数

233是素数

338是素数

443是素数

548是素数

653是素数

758是素数

863是素数

968是素数

我们知道,大于1,并且除1和它本身外没有其他因数的自然数叫素数(或质数) ,2是最小的素数,除2以外,所有的偶数都不是素数。



作者 Re:一个算术题,是求什么的?请教 [Re:xndd]
ranchgirl



版主


发贴: 801
积分: 132
于 2005-11-28 22:02 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
xndd wrote:
就是除3余2,除5余3,除7余2的这个,到底是不是素数?我感觉不是啊


感觉?? Have you tried it????

I really really hate somebody who copies something from nowhere, and don't know what it does, then waste everybody's time to analyse it.

If you don't know what you are doing, nobody should spend his/her time to analyse it.

Please don't, never, answer such questions!

Thanks!



作者 Re:一个算术题,是求什么的?请教 [Re:xndd]
耀不燃





发贴: 12
积分: 0
于 2006-01-03 20:33 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
一本书上的一个例子,关于我国古代的一个数学问题,仅此而已


作者 Re:一个算术题,是求什么的?请教 [Re:xndd]
comper





发贴: 1
积分: 0
于 2006-01-04 14:17 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
查查素数的定义!感觉有点问题


作者 Re:一个算术题,是求什么的?请教 [Re:comper]
wangyabing





发贴: 18
积分: 0
于 2006-01-04 14:57 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
素数就是除能被自己本身整除以外不能被别的数整除的数就是素数


作者 Re:一个算术题,是求什么的?请教 [Re:wangyabing]
why

問題兒童

总版主


发贴: 4629
积分: 388
于 2006-01-04 23:53 user profilesend a private message to usersend email to whysearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
wangyabing wrote:
素数就是除能被自己本身整除以外不能被别的数整除的数就是素数

廢話少說
好不好?



作者 Re:一个算术题,是求什么的?请教 [Re:xndd]
DeadPoet





发贴: 5
积分: 0
于 2006-01-05 19:20 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
好无聊啊,自己试试不就知道了...



flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923