首页 > 大学专科> 电子信息
题目内容 (请给出正确答案)
[主观题]

写出下列程序段的输出结果(栈的元素类型SElemType为char)。 void main() { Stack S; char x,y; lnit

写出下列程序段的输出结果(栈的元素类型SElemType为char)。

void main()

{

Stack S;

char x,y;

lnitStack(S);

x='c';

y='k';

Push(S,x);

Push(S,'a');

Push(S,y);

Pop(S,x);

Push(S,'t');

Push(S,x);

Pop(S,x);

Push(S,'s');

While(!StackEmpty(S))

{

Pop(S,y);

printf(y);

}

printf(x);

}

查看答案
答案
收藏
如果结果不匹配,请 联系老师 获取答案
您可能会需要:
您的账号:,可能还需要:
您的账号:
发送账号密码至手机
发送
安装优题宝APP,拍照搜题省时又省心!
更多“写出下列程序段的输出结果(栈的元素类型SElemType为c…”相关的问题
第1题
写出下列程序输出结果()。#include<stdio.h >main(){int a=3, b=5,s; ;s=a*b;printf (s=%d/n, s);}
写出下列程序输出结果()。#include<stdio.h >main(){int a=3, b=5,s; ;s=a*b;printf (s=%d/n, s);}

点击查看答案
第2题
请写出下面程序的输出结果。def fun(s,n):If n==1:return Is[0];t=fun(s,n-1)if t<ls[n-1]:retu
请写出下面程序的输出结果。def fun(s,n):If n==1:return Is[0];t=fun(s,n-1)if t<ls[n-1]:retu

请写出下面程序的输出结果。

def fun(s,n):

If n==1:

return Is[0];

t=fun(s,n-1)

if t<ls[n-1]:

return t

else:

return Is[n-1]

print(fun([35,27,29,50-1],5)

print(fun([35,27,29,50-1],3))

点击查看答案
第3题
下列是Java程序,演示的是变量类型的强制转换,请补充划线的部分,使输出结果为b=12。 public cla
s sTestaaa{ public static void main(String args[ ]) { short S=12; byte b=【 】; //将s变量强制转换成byte类型 System.out.print("b="+b) ; } }

点击查看答案
第4题
以下程序段的输出结果为_____。 class Cruncher{ void crunch(int i) { System.out.p

以下程序段的输出结果为_____。 class Cruncher{ void crunch(int i) { System.out.println("int"); } void crunch(String s){ System.out.println("String"); } public static void main(String args[]){ Cruncher crun=new Cruncher(); char ch="p": crun.crunch(ch); } }

点击查看答案
第5题
写出下列程序的输出结果______。 main() { int n=0; while(n++<=1) ; printf(

写出下列程序的输出结果______。 main() { int n=0; while(n++<=1) ; printf("%d,",n); printf("%d",n++); }

点击查看答案
第6题
写出下列程序的输出结果 ______。 main() { int=0; while(n++<=1); printf("%d,",n);

写出下列程序的输出结果 ______。 main() { int=0; while(n++<=1); printf("%d,",n); printf("%d",n++); }

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

请帮忙给出正确答案和分析,谢谢!

点击查看答案
第8题
简述以下算法的功能(栈和队列的元素类型均为int)。 void algo(Queue&Q) { Stack S; int d; IntStack

简述以下算法的功能(栈和队列的元素类型均为int)。

void algo(Queue&Q)

{

Stack S;

int d;

IntStack(S);

While(!StackEmpty(S))

{

Pop(S,d);

EnQueue(Q,d);

}

}

点击查看答案
第9题
阅读下列程序并写出程序运行结果。Private Sub Form_Click()Dim x As IntegerStatic y As Integ
阅读下列程序并写出程序运行结果。Private Sub Form_Click()Dim x As IntegerStatic y As Integ

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

Private Sub Form_Click()

Dim x As Integer

Static y As Integer

x = x + 2

y = y + 3

Form1.Print "x="; x, "y="; y

End Sub

写出程序运行时连续单击三次窗体后,Form1上的输出结果。

点击查看答案
第10题
阅读下列程序,请写出该程序的输出结果。public class C{int x=10;static int y=20;public stat

阅读下列程序,请写出该程序的输出结果。

public class C

{

int x=10;

static int y=20;

public static void main(String[] args)

{

C obj1=newC();

C obj2=newC();

obj1.x*=2;

obj1.y*=3;

obj2.x+=4;

obj2.y+=5;

System.out.println(obj1.x);

System.out.println(obj1.y);

System.out.println(obj2.x);

System.out.println(obj2.y);

}

}

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