a我考网

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 169|回复: 0

[考试试题] 2012JAVA模拟试题及答案:编程题27

[复制链接]
发表于 2012-8-4 12:33:16 | 显示全部楼层 |阅读模式
【程序27】    + [# W0 Q; g& b
题目:求100之内的素数    5 w% y+ `+ ^/ |
//使用除sqrt(n)的方法求出的素数不包括2和3 ) X5 D- x, ?9 B( G6 ?# s3 B
public class lianxi27 {
4 x# x# T& f; V, R% Xpublic static void main(String[] args) { ( A9 j1 l, @, Y4 Y+ L
    boolean b =false;
: X( R! p- z0 Q" {, N    System.out.print(2 + " "); ! N- u. b% p6 K' A! e! n2 W- N
    System.out.print(3 + " ");   F* {+ u; x7 p$ G9 s' U
    for(int i=3; i
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Woexam.Com ( 湘ICP备18023104号 )

GMT+8, 2024-5-6 01:57 , Processed in 0.245501 second(s), 21 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表