首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
执行后的输出结果是( )。 #include<iostream.h> void main() { int i(0); while(++i) { if(i==10)break; if(i%3
执行后的输出结果是( )。 #include<iostream.h> void main() { int i(0); while(++i) { if(i==10)break; if(i%3
admin
2019-04-01
66
问题
执行后的输出结果是( )。
#include<iostream.h>
void main()
{
int i(0);
while(++i)
{
if(i==10)break;
if(i%3!=1)continue;
cout<<i<<end1;
}
选项
A、1 4 7
B、2 4 7
C、4 3 2
D、7 3 1
答案
A
解析
从if(i==10)break;语句了解本循环只到10,输出i的条件是只要1-10之间的数对3取余为1的输出,所以输出的1 4 7。
转载请注明原文地址:https://www.kaotiyun.com/show/AaAp777K
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
下列程序编译错误,因为add函数返回值是一个引用,故对return返回值的要求是______。#include<iostream.h>int&add(intx,inty){returnx+y;}vo
下面程序的运行结果为#include<iostream.h>classA{public:A(){cout<<"1";}~A(){cout<<"2";}};class
下面程序的运行结果为#include<iostream.h>voidmain(){for(inta=0,x=0;!x&&a<=10;a++){a++;
下面程序的输出结果是()。#include<iostream.h>Classexample{inta;public:example(intB.{a=b++;}voidprint(){a=a+1
下面是关于派生类声明的开始部分,其中正确的是()。
下面有关重载函数的描述中正确的是()。
如下类定义中包含了构造函数和复制构造函数的原型声明,请在画线处填写正确的内容,使复制构造函数的声明完整。classmy(21ass{private:intdata:public::MyClass(int
下列关于C++流的叙述中,正确的是
一棵二叉树第6层(根结点为第一层)的结点最多为______个。
随机试题
在夹具中,夹紧力的作用方向应与钻头轴线的方向()。
早期食管癌诊断的必要条件是
一般均需摄双侧以资对比的是
Troubledcorporationsmustsometimesdeclarebankruptcywhentheleveloftheirdebtbecomes_______.
《四川省旅游条例》中规定,旅游者在旅游活动中应该承担哪些义务?
在人类文明史上,古埃及人和两河流域的苏美尔人,都曾创造过古老的文字。然而,随着时间的流逝,这些文字早已消亡。时至今日,__________的古老文字,唯有中国人创立的汉字。作为伟大的汉文化的载体和媒介,汉字依然__________,堪称当今世界上最有生命力
Whichsporthasthemostexpenses______trainingequipment,players’personalequipmentanduniforms?
MasstransportationrevisedthesocialandeconomicfabricoftheAmericancityinthreefundamentalways.Itspeededupphysica
TheArtofPublicSpeakingIfyouweretotape-recordoneofDavidLetterman’scomedyroutines,memorizeitwordforword,a
Aremarkablevarietyofinsectsliveinthisplanet.Morespeciesofinsectsexistthanallotheranimalspeciestogether.Insec
最新回复
(
0
)