首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
阅读以下说明及Visual Basic 程序代码,将应填入(n)处的字句写在对应栏内。 [说明] 本程序求3~100之间的所有素数(质数)并统计个数;同时将这些素数从小到大依次写入顺序文件E: \dataout.txt;素数的个数显示在窗体Form1
阅读以下说明及Visual Basic 程序代码,将应填入(n)处的字句写在对应栏内。 [说明] 本程序求3~100之间的所有素数(质数)并统计个数;同时将这些素数从小到大依次写入顺序文件E: \dataout.txt;素数的个数显示在窗体Form1
admin
2009-02-15
19
问题
阅读以下说明及Visual Basic 程序代码,将应填入(n)处的字句写在对应栏内。
[说明]
本程序求3~100之间的所有素数(质数)并统计个数;同时将这些素数从小到大依次写入顺序文件E: \dataout.txt;素数的个数显示在窗体Form1上。
[Visual Basic 代码]
Private Sub Command1_ Click ( )
Dim count as integer, flag as Boolean
Dim t1 as Integer, t2 as Integer
(1)
Count=0
For t1=3 to 100
Flag=Tree
For t2=2 to Int( Sqr ( t1 ) )
If (2) Then flag=False
Next t2
(3)
count=(4)
write #1, t1
End if
Next t1
(5)
Close #1
End Sub
选项
答案
(1) Open "e:\dataout.txt" For Output as #1 (2) t1 mod t2=0 (3) If t2>Int (sqr(t1))Then (4) count +1 (5) Form1.Print "素数个数"; count
解析
转载请注明原文地址:https://kaotiyun.com/show/IojZ777K
本试题收录于:
程序员下午应用技术考试题库软考初级分类
0
程序员下午应用技术考试
软考初级
相关试题推荐
为查看Windows系统当前正在运行哪些应用程序或进程,可用(43)组合键实现。
在SQL中,GROUPBY子句用于()。
在信息收集过程中,需要根据项目的目标把握数据(7)________________要求,既不要纳入过多无关的数据,也不要短缺主要的数据;既不要过于简化,也不要过于烦琐。
计算机网络中,防火墙的功能不包括________________。
操作系统的资源管理功能不包括________________。
下列快捷功能按钮中,可以在画好的图形内填充颜色的是(49)。
在Excel2007中,在单元格A1中输入函数“=LEN(”信息处理技术员”)”,按回车键后,则A1单元格中的值为__________。
在Excel2010的A1单元格中输入函数“=IF(1<>2,1,2)”,按回车键后,A1单元格中的值为________________。
某商场记录(统计)销售情况的数据库中,对每一种商品采用了国家统一的商品编码。这种做法的好处不包括(11)________________。
随机试题
我国将24种矿产列为战略性矿产资源。下列与之相关的说法错误的是:
在重力的作用下物体从离地面高100米处自由下落,不计空气阻力时,物体的下落路程s与时间t满足关系式s=1/2gt2,其中g是重力加速度,则这个函数的定义域是()
听神经瘤的特点不包括
某男,9岁。感冒1周后全身皮肤出现瘀点,经诊断确诊为特发性血小板减少性紫癜出血。治疗应首选
关于犯罪嫌疑人、被告人逃匿、死亡案件违法所得的没收程序,下列说法正确的是:()
均质圆环的质量为m,半径为R,圆环绕O轴的摆动规律为φ=ωy,ω为常数。图4-74所示瞬时圆环对转轴O的动量矩为()。
在城市道路设计中,下列情况下可以不设置竖曲线的是()
根据以下资料。回答以下题。22010年大陆地区总人口性别比例(以男性人口为100,男性对女性的比例)为()
站在辽阔的大草原上,轻风拂面,微阖眼睑,脑海_______这样的镜头:平静的黄河之中,一匹龙马突然冲破水面,昂首抖落珍珠般的水滴,刚劲矫健的四蹄踏浪驮书,使“伏羲氏有天下”。那是多么神奇撼人、_______的画面。填入画横线部分最恰当的一项是:
Geographyisstudyoftherelationshipbetweenpeopleandtheland.Geographerscompareandcontrast【C1】______placesontheea
最新回复
(
0
)