【计算机类职业资格】循环结构(一)及答案解析.doc

上传人:deputyduring120 文档编号:1335513 上传时间:2019-10-17 格式:DOC 页数:6 大小:41KB
下载 相关 举报
【计算机类职业资格】循环结构(一)及答案解析.doc_第1页
第1页 / 共6页
【计算机类职业资格】循环结构(一)及答案解析.doc_第2页
第2页 / 共6页
【计算机类职业资格】循环结构(一)及答案解析.doc_第3页
第3页 / 共6页
【计算机类职业资格】循环结构(一)及答案解析.doc_第4页
第4页 / 共6页
【计算机类职业资格】循环结构(一)及答案解析.doc_第5页
第5页 / 共6页
点击查看更多>>
资源描述

1、循环结构(一)及答案解析(总分:18.00,做题时间:90 分钟)一、B选择题/B(总题数:18,分数:18.00)1.有以下程序 main() int i=0,s=0; for(;) if(i=3|i=5)continue; if(i=6) break; i+; s+=i; ; printf(“%d/n“,s); 程序运行后的输出结果是_。(分数:1.00)A.10B.13C.21D.程序进入死循环2.运行以下程序后,如果从键盘上输入 6514回车,则输出结果为_。 main() int m,n; printf(“Enter m,n:“); scanf(“%d%d“,j=3;j+) if(j

2、2) continue;x+; x+; printf(“x=% d/n“,x); (分数:1.00)A.x=4B.x=8C.x=6D.x=128.下面程序的功能是:计算 110 之间的奇数之和及偶数之和,空白处应填_。 main() int a,b,c,i; a=c=0; for(i=0;i=10;i+=2) a+=i;_;) printf(“偶数之和=%d/n“,a); printf(“奇数之和=%d/n“,c-11); (分数:1.00)A.c+=iB.c+=i+1C.b+=iD.b+=i+19.下列程序段中循环体的执行次数是_。 int x=-12; while (x=0) x=x+1

3、分数:1.00)A.While循环执行 12次B.循环体语句执行一次C.循环是死循环D.循环体语句一次也不执行10.以下程序的输出结果是_。 main() int i,j,m=0; for (i=1;i=15;i+=4) for(j=3; j=19; j+=4) m+; printf(“%d/n“,m); (分数:1.00)A.12B.15C.20D.2511.以下程序的输出结果是_。 main() int x=2; do printf(“%3d“,!x-2); while(-x); (分数:1.00)A.0 -1B.0 0C.-2-2D.死循环12.以下程序运行后,输出结果为_。 mai

4、n() int y=18,i=0 j,a8; do ai=y%2; i+; y=y/2; while(y=1); for(j=1-1;j=0;j-) printf(“%d“,aj); printf(“/n“); (分数:1.00)A.10000B.10010C.00110D.1010013.有以下程序 main() int p8=11,12,13,14,15,16,17,18,i=0,j=0; while(i+7) if(pi%2)j j+=pi; printf(“%d/n“,j); 程序运行后的输出结果是_。(分数:1.00)A.42B.45C.56D.6014.下面的程序输出结果是_。 m

5、ain() int x=3; while(!(-x) printf(“%d/n“,x-=2); (分数:1.00)A.不执行循环体B.1C.0D.是死循环15.有如下程序 main() int n=9; while(n6) n-; printf(“%d“,n); 该程序段的输出结果是_。(分数:1.00)A.987B.876C.8765D.987616.下面程序的执行结果为_。 main() int a,b; for(a=1,b=1;a=100;a+) if(b=20) break; if(b%3=1) b+=3; continue; b-=5; printf(“%d“,a); (分数:1.0

6、0)A.7B.8C.9D.1017.以下循环体的执行次数是_。 main() int i,j; for(i=0, j=1;i=j+1; i+=2,j-) printf(“%d/n“,i) (分数:1.00)A.3B.2C.1D.018.执行下面程序段的结果是_。 int x=234; do printf(“%3d/n“,x-); while(!x);(分数:1.00)A.432B.234C.0D.234到 1的自然数循环结构(一)答案解析(总分:18.00,做题时间:90 分钟)一、B选择题/B(总题数:18,分数:18.00)1.有以下程序 main() int i=0,s=0; for(;

7、) if(i=3|i=5)continue; if(i=6) break; i+; s+=i; ; printf(“%d/n“,s); 程序运行后的输出结果是_。(分数:1.00)A.10B.13C.21D.程序进入死循环 解析:2.运行以下程序后,如果从键盘上输入 6514回车,则输出结果为_。 main() int m,n; printf(“Enter m,n:“); scanf(“%d%d“,j=3;j+) if(j%2) continue;x+; x+; printf(“x=% d/n“,x); (分数:1.00)A.x=4B.x=8 C.x=6D.x=12解析:8.下面程序的功能是:

8、计算 110 之间的奇数之和及偶数之和,空白处应填_。 main() int a,b,c,i; a=c=0; for(i=0;i=10;i+=2) a+=i;_;) printf(“偶数之和=%d/n“,a); printf(“奇数之和=%d/n“,c-11); (分数:1.00)A.c+=iB.c+=i+1 C.b+=iD.b+=i+1解析:9.下列程序段中循环体的执行次数是_。 int x=-12; while (x=0) x=x+1;(分数:1.00)A.While循环执行 12次B.循环体语句执行一次C.循环是死循环D.循环体语句一次也不执行 解析:10.以下程序的输出结果是_。 ma

9、in() int i,j,m=0; for (i=1;i=15;i+=4) for(j=3; j=19; j+=4) m+; printf(“%d/n“,m); (分数:1.00)A.12B.15C.20 D.25解析:11.以下程序的输出结果是_。 main() int x=2; do printf(“%3d“,!x-2); while(-x); (分数:1.00)A.0 -1B.0 0C.-2-2 D.死循环解析:12.以下程序运行后,输出结果为_。 main() int y=18,i=0 j,a8; do ai=y%2; i+; y=y/2; while(y=1); for(j=1-1;

10、j=0;j-) printf(“%d“,aj); printf(“/n“); (分数:1.00)A.10000B.10010 C.00110D.10100解析:13.有以下程序 main() int p8=11,12,13,14,15,16,17,18,i=0,j=0; while(i+7) if(pi%2)j j+=pi; printf(“%d/n“,j); 程序运行后的输出结果是_。(分数:1.00)A.42B.45 C.56D.60解析:14.下面的程序输出结果是_。 main() int x=3; while(!(-x) printf(“%d/n“,x-=2); (分数:1.00)A.

11、不执行循环体 B.1C.0D.是死循环解析:15.有如下程序 main() int n=9; while(n6) n-; printf(“%d“,n); 该程序段的输出结果是_。(分数:1.00)A.987B.876 C.8765D.9876解析:16.下面程序的执行结果为_。 main() int a,b; for(a=1,b=1;a=100;a+) if(b=20) break; if(b%3=1) b+=3; continue; b-=5; printf(“%d“,a); (分数:1.00)A.7B.8 C.9D.10解析:17.以下循环体的执行次数是_。 main() int i,j; for(i=0, j=1;i=j+1; i+=2,j-) printf(“%d/n“,i) (分数:1.00)A.3B.2C.1 D.0解析:18.执行下面程序段的结果是_。 int x=234; do printf(“%3d/n“,x-); while(!x);(分数:1.00)A.432B.234 C.0D.234到 1的自然数解析:

展开阅读全文
相关资源
猜你喜欢
  • ITU-R INFORME P 228-3 SPANISH-1986 Measurement of field strength for VHF (metric) and UHF (decimetric) broadcast services including television《甚高频和超高频广播服务包括电视在内的磁场强度测量》.pdf ITU-R INFORME P 228-3 SPANISH-1986 Measurement of field strength for VHF (metric) and UHF (decimetric) broadcast services including television《甚高频和超高频广播服务包括电视在内的磁场强度测量》.pdf
  • ITU-R INFORME P 239-7 SPANISH-1990 PROPAGATION STATISTICS REQUIRED FOR BROADCASTING SERVICES USING THE FREQUENCY RANGE 30 TO 1000 MHz《使用频率范围30至1000 MHz的广播服务所需的传播统计》.pdf ITU-R INFORME P 239-7 SPANISH-1990 PROPAGATION STATISTICS REQUIRED FOR BROADCASTING SERVICES USING THE FREQUENCY RANGE 30 TO 1000 MHz《使用频率范围30至1000 MHz的广播服务所需的传播统计》.pdf
  • ITU-R INFORME P 880-2 SPANISH-1990 SHORT DISTANCE RADIO-WAVE PROPAGATION IN SPECIAL ENVIRONMENTS Buildings tunnels mines etc 《短距离的电波传播在特殊环境中的应用如建筑物、隧道、矿山等》.pdf ITU-R INFORME P 880-2 SPANISH-1990 SHORT DISTANCE RADIO-WAVE PROPAGATION IN SPECIAL ENVIRONMENTS Buildings tunnels mines etc 《短距离的电波传播在特殊环境中的应用如建筑物、隧道、矿山等》.pdf
  • ITU-R INFORME RA 2099 SPANISH-2007 Radio observations of pulsars for precision timekeeping《精密计时脉冲星射电观测》.pdf ITU-R INFORME RA 2099 SPANISH-2007 Radio observations of pulsars for precision timekeeping《精密计时脉冲星射电观测》.pdf
  • ITU-R INFORME RA 2126 SPANISH-2007 Techniques for mitigation of radio frequency interference in radio astronomy《无线电天文学中无线电频率干扰的缓解技术》.pdf ITU-R INFORME RA 2126 SPANISH-2007 Techniques for mitigation of radio frequency interference in radio astronomy《无线电天文学中无线电频率干扰的缓解技术》.pdf
  • ITU-R INFORME RS 2094 SPANISH-2007 Studies related to the compatibility between Earth exploration-satellite service (active) and the radiodetermination service in the 9 300-9 500 Mth e.pdf ITU-R INFORME RS 2094 SPANISH-2007 Studies related to the compatibility between Earth exploration-satellite service (active) and the radiodetermination service in the 9 300-9 500 Mth e.pdf
  • ITU-R INFORME RS 2095 SPANISH-2007 Sharing of the 36-37 GHz band by the fixed and mobile services and the Earth exploration-satellite service (passive)《共享36-37 GHz频段的固定和移动业务以及地球探测卫.pdf ITU-R INFORME RS 2095 SPANISH-2007 Sharing of the 36-37 GHz band by the fixed and mobile services and the Earth exploration-satellite service (passive)《共享36-37 GHz频段的固定和移动业务以及地球探测卫.pdf
  • ITU-R INFORME RS 2096 SPANISH-2007 Sharing of the 10 6-10 68 GHz band by the fixed and mobile services and the Earth exploration-satellite service (passive)《共享10 6-10 68 GHz频段的固定和移.pdf ITU-R INFORME RS 2096 SPANISH-2007 Sharing of the 10 6-10 68 GHz band by the fixed and mobile services and the Earth exploration-satellite service (passive)《共享10 6-10 68 GHz频段的固定和移.pdf
  • ITU-R INFORME S 2151 SPANISH-2009 Use and examples of systems in the fixed-satellite service in the event of natural disasters and similar emergencies for warning and relief operat.pdf ITU-R INFORME S 2151 SPANISH-2009 Use and examples of systems in the fixed-satellite service in the event of natural disasters and similar emergencies for warning and relief operat.pdf
  • 相关搜索

    当前位置:首页 > 考试资料 > 职业资格

    copyright@ 2008-2019 麦多课文库(www.mydoc123.com)网站版权所有
    备案/许可证编号:苏ICP备17064731号-1