网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
单选题
如果输入的数据是2,3,4,则下面程序的输出应为() PROGRAM SAM(INPUT,OUTPUT); VAR i,x,y:integer; BEGIN FOR i:=1 TO 3 DO BEGIN Read(x); y:=sqr(x)END; Writeln(‘x=’,x,‘y=’,y)END.
A
x=2 y=4 x=3 y=9 x=4 y=16
B
x=4 y=16 x=4 y=16 x=4 y=16
C
x=4 y=16
D
x=2 y=4 x=2 y=4 x=2 y=4
参考答案
参考解析
解析:
暂无解析
更多 “单选题如果输入的数据是2,3,4,则下面程序的输出应为() PROGRAM SAM(INPUT,OUTPUT); VAR i,x,y:integer; BEGIN FOR i:=1 TO 3 DO BEGIN Read(x); y:=sqr(x)END; Writeln(‘x=’,x,‘y=’,y)END.A x=2 y=4 x=3 y=9 x=4 y=16B x=4 y=16 x=4 y=16 x=4 y=16C x=4 y=16D x=2 y=4 x=2 y=4 x=2 y=4” 相关考题
考题
有下列程序 program test(input,output); var s:integer; ch:char; count:array[‘a‘..‘z‘]of integer; begin for ch:=‘a‘to‘z‘do count[ch]:=0; read(ch); while not eoln do begin if(ch>=‘a‘)and(chx[5])and(x[c]/c0) or not(x[a+b]>(a+b))的值是( )。AtrueBfalseC0D1
考题
阅读下列程序说明和C代码,把应填入其中n处的字句写在对应栏内。【说明】下面的程序能够计算不同图形的面积。程序中把每个图形的数据定义成结构类型,利用共同体类型描述2种图形的数据。程序根据输入参数代表的图形类型,求出图形的面积并输出。【程序】struct Circle{float x,y; /*圆心位置*/float r; /*圆半径*/};struct Rectangle{float width; /*矩形宽*/float length; /*矩形长*/};union shape{struct Circle circle;/*圆数据结构*/struct Rectangle rectangle;/*矩形数据结构*/};main(){union shape a;float area;int i;printf(“input number: 1circle,2rectangle,3 end\n”);scanf("%d",i);while (1) /*循环接收输入,并计算输出*/{switch(i){case 1:printf(“input radius:\n”);scanf(“%f”, (2);/*共同体类型变量接收输入*/area=3.1415926* (3);printf(“the area of circle=%f\n”,area);break;case 2:printf(“input width and length :\n”);seanf(“%f,%f”, (4);/*共同体类型变量接收输入*/。area=(5);printf(“the area of rectangle=%f\n”,area);break;}printf(“input number:1 circle,2 rectangle,3 end\n”);scanf(“%d”,i);}}
考题
下列程序的功能是:将数据1,2,......,8写入顺序文件Num.txt中,请选择正确的程序段 Private Sub Form_Click() Dim i As Integer Open "Num.txt"For Output As #1 For i=1 To 8 ______ Next i Close #1 End SubA.print#1,i B.input#1,i C.print#1 D.input#1
考题
将下面Shell程序段中的空缺部分补齐,使得它可以将指定的一个或多个输入文件的内容依次添加到输出文件的末尾,如果指定的输出文件不存在,则程序应自动产生一个输出文件。if ["$#" -lt 2 ];thenecho "usage $0 <output-file> <input file 1> [<input file 2>…]"exit 0fioutput="$1"shiftfor i in (61); doif[-e "Si"];then # or use '-a $i'cat (62)fidoneA.$#B.$IC.$!D.$@
考题
设程序中有如下语句:x-input box(“输入”,”数据”,100)print x运行程序,执行上述语句,输入5并单击输入对话框上的“取消”按钮,则窗体上输出A)0B)5C)100D)空白
考题
下列程序的功能是:将数据1,1,…,8写入顺序文件Num.txt中,请选择正确的程序段( )。Private Sub Form_Click()Dim i As IntegerOpen"Num.txt"For Output As #1For i=1 To 8______Next iClose #1End SubA.print#1,iB.input#1,IC.print#1D.input#1
考题
下列程序的功能是:将数据1,2,…,8写入顺序文件Num.txt中,请选择正确的程序段( )。 Private Sub Form_Click() Dim i As Integer Open "Num.txt" For Output As #1 For i=1 To 8 ______ Next i Close #1 End SubA.print #1,iB.input #1,iC.print #1D.input #1
考题
执行如下程序SET TALK OFFS=0I=1INPUT "N=" TO NDO WHILE S
执行如下程序SET TALK OFFS=0I=1INPUT "N=" TO NDO WHILE SS=S+II=I+1ENDDO?SSET TALK ON如果输入值为5,则最后S的显示值是( )。A.1B.3C.5D.6
考题
将下面Shell 程序段中的空缺部分补齐,使得它可以将指定的一个或多个输入文件的内容依次添加到输出文件的末尾。如果指定的输出文件不存在,则程序应自动产生一个输出文件。if ["$#"-It 2];thenecho "Usage $0<output-file><input file l>[<input file2>...]"exit 0fiutput="$1"shiftfor i in (41) ;doif [ -e "$i"];then # or use'-a $i'cat (42)fidoneA.$#B.$iC.$!D.$@
考题
Program(73)describes program's objectives, desired output, input data required, processing requirement, and documentation.A.specification
B.flowchart
C.structure
D.address
考题
Program( )describes program's objectives,desired output,input data required,processing requirement,and documentation.A.specification
B.flowchart
C.structure
D.address
考题
输入输出设备简称I/O(Input/Output)设备,以下关于计算机I/O设备的论述中,正确的是()。1、输入设备是指能向计算机系统输入信息的设备2、输出设备一般是指能从计算机系统中输送出人可直接识别的信息的设备3、用户只能通过I/O设备和计算机交互4、相对而言,I/O设备是计算机系统中运转速度最慢的设备5、所有I/O设备的操作,是由程序中的输入/输出指令或输入/输出语句统一控制的。A、125B、123C、124D、全部
考题
单选题分析下面的PASCAL程序,给出正确的运行结果() PROGRAM mx(input,output); VAR R,s,t:integer; PROCEDURE change(a,b:integer); VAR T:integer; BEGIN A:=3*a; B:=2*b; T:=a+b; End; BEGIN R:=2;s:=4;t:=6; Change(r,s); Writeln(‘r=’,r,’s=’,s,’t=’,t)End.A
r=2 s=4 t=6B
r=2 s=4 t=14C
r=6 s=8 t=6D
r=6 s=8 t=14
考题
判断题输入设备和输出设备简称为I/O(Input/Output)设备。A
对B
错
热门标签
最新试卷