首页 > 其他
题目内容 (请给出正确答案)
[单选题]

分析下列程序段,写出程序运行结果()s=1for n=1 to 3s=s+nprint snext

A.1 4 7

B.4 7 10

C.2 4 6

D.2 4 7

答案
收藏

D、2 4 7

如果结果不匹配,请 联系老师 获取答案
您可能会需要:
您的账号:,可能还需要:
您的账号:
发送账号密码至手机
发送
安装优题宝APP,拍照搜题省时又省心!
更多“分析下列程序段,写出程序运行结果()s=1for n=1 t…”相关的问题
第1题
写出下列程序段的输出结果。(假设此栈中元素的类型是char) voide main() {stack s; char x,y;

写出下列程序段的输出结果。(假设此栈中元素的类型是char)

voide main()

{stack s;

char x,y;

InitStack(s)

x=‘1’,y=‘0’

push(s,x);

push(s,x);

push(s,y);

push(s,x);

push(s,‘e’);

push(s,x);

pop(s,x);

push(s,‘h’);

while(!stackEmpty(s))

{pop(s,y);

printf(y);

}

prinft(x)

}

点击查看答案
第2题
写出下列程序的运行结果。#include void Fun(){int num=20;cout<< "The Fun's num i
写出下列程序的运行结果。#include void Fun(){int num=20;cout<< "The Fun's num i

写出下列程序的运行结果。

#include void Fun(){int num=20;cout<< "The Fun's num is"<< num<< endl;

}void main(){int num=10;cout<< "The main's num is "<< num<< endl;Fun();{int num=30;

cout<< "The Field's num is "<< num<< endl;}cout<< "The main's num is "<< num<< endl;}

点击查看答案
第3题
下列程序段的运行结果为:PARAMETER(N=3)INTEGERA(N,N),SDATAA/1,2,3,4,5,6,7,8,9/S=0DOI=1,NS=S+A(I,I)ENDDOPRINT*,SEND程序运行结果为:()。

A.9

B.10

C.15

D.24

点击查看答案
第4题
分析并写出下列程序的运行结果。

点击查看答案
第5题
已知下列的程序,请写出运行该程序后屏幕上输出的结果∶

点击查看答案
第6题
阅读下列程序,请写出程序的运行结果。public class C{public static void main(String[] args)

阅读下列程序,请写出程序的运行结果。

public class C

{

public static void main(String[] args)

{

String text="public static void main(String[] args)";

int theCount=0;

int index=-1;

String theStr="i";

index=text.indexOf(theStr);

while(index>=0)

{

++theCount;

index+=theStr.length();

index=text.indexOf(theStr,index);

}

System.out.println("The Text contains"+theCount+"i");

}

}

点击查看答案
第7题
阅读下列程序并写出程序运行结果。Public Sub change1(ByVal x As Integer, ByVal y As Integer
阅读下列程序并写出程序运行结果。Public Sub change1(ByVal x As Integer, ByVal y As Integer

阅读下列程序并写出程序运行结果。

Public Sub change1(ByVal x As Integer, ByVal y As Integer)

Dim t As Integer

t = x

x = y

y = t

End Sub

Public Sub change2(x As Integer, y As Integer)

Dim t As Integer

t = x

x = y

y = t

End Sub

Private Sub Form_Click()

Dim a As Integer, b As Integer

a = 22: b = 33

change1 a, b

Form1.Print "A1="; a, "B1="; b

a = 22: b = 33

change2 a, b

Form1.Print "A2="; a, "B2="; b

End Sub

写出程序运行时,单击窗体Form1上的输出结果。

点击查看答案
第8题
写出以下程序段的输出结果(队列中的元素类型Q Elem Type为char)。

写出以下程序段的输出结果(队列中的元素类型Q Elem Type为char)。

点击查看答案
第9题
请写出如下程序的执行结果。s = 0 for i in range(1, 11):if i % 2 == 0:continueif i % 10 ==
请写出如下程序的执行结果。s = 0 for i in range(1, 11):if i % 2 == 0:continueif i % 10 ==

请写出如下程序的执行结果。

s = 0 for i in range(1, 11):

if i % 2 == 0:

continue

if i % 10 == 5:

break

s=s+i print(s)

点击查看答案
第10题
请先分析说明表达式(*p)++和*p++的不同含义,然后写出下面程序的运行结果。
请先分析说明表达式(*p)++和*p++的不同含义,然后写出下面程序的运行结果。

点击查看答案
第11题
运行下列程序段之后,标签Label1 显示的结果为()。 A = 10 : B = 30 : If A < B Then Label1.Text = B & A

A.10

B.30

C.1030

D.3010

点击查看答案
退出 登录/注册
发送账号至手机
密码将被重置
获取验证码
发送
温馨提示
该问题答案仅针对搜题卡用户开放,请点击购买搜题卡。
马上购买搜题卡
我已购买搜题卡, 登录账号 继续查看答案
重置密码
确认修改