题目内容 (请给出正确答案)
[主观题]

若输入:2017123412,写出下面程序的执行结果。 class Program { static void Main(string[] args) { Console.Write("请输入学号:"); int no = int.Parse(Console.ReadLine()); no = no % 100; if (no % 3 == 0) Console.Write("选择1、4题");

提问人:网友hfzhujun 发布时间:2022-01-07
参考答案
  抱歉!暂无答案,正在努力更新中……
如搜索结果不匹配,请 联系老师 获取答案
更多“若输入:2017123412,写出下面程序的执行结果。 cl…”相关的问题
第1题
写出下面程序的执行结果。

public class exception1

{

void Proc(int sel) throws ArithmeticException,ArrayIndexOutOfBoundsException

{

System.out.println("In Situation" + sel ) ;

if (sel==0)

{

System.out.println("no Exception caught");

return;

}

else if (sel==l)

{

int iArray[]=new int[4] ;

iArray [10 ] =3 ;

}

}

public static void main(String args[])

{

try {

Proc (0 ) ;

Proc (1 ) ;

}

catch (ArrayIndexOutOfBoundsException e)

{

System.out.println ("Catch"+e) ;

}

}

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

点击查看答案
第3题
下面程序运行时从键盘上分别输入(20,15),(15,20),写出运行结果及程序功能。/* c3-5.c 分支结构中的复合语句*/ #include "stdio.h" main( ) { int a,b,t; t = 0; scanf("%d,%d",&a,&b); if (a>b) { t = a ; a = b ; b = t ; } printf("a=%d,b=%d\n",a,b) ; }
点击查看答案
第4题
下面程序运行时从键盘上输入“6”,写出程序的运行结果。 #include <iostream> using namespace std; void sub____ { while ____!='\0'); while ____<b)*____ *____; *____="b;" } void main____ { char s[]="97531" ,c; c="cin.get____;" sub____; cout s;>
点击查看答案
第5题
若执行下面的程序时,从键盘输入5和2,则输出结果是

main()

{ int a,b,k;

scanf("%d,%d",&a,&b);

k=a;

if(a<b)k=a%b;

else k=b%a;

printf("%d\n",k);}

A.5

B.3

C.2

D.0

点击查看答案
第6题
写出下面程序的执行结果。 class Program { static void Main(string[] args) { user[] s2 = new user[2]; for (int i = 1; i <= s2.length; i++) s2[i - 1]="new" user("章", "00000" + i.tostring()); string str="用户\n" ; foreach (user s in s2) username "+" s. password "\n"; console.writeline(str); } user { public username; password; user(string username, password) this.username="userName;" this.password="password;">
点击查看答案
第7题
若输入: 11 12 13 14 15 0 则写出下面程序的输出结果。 class Program { static void Main(string[] args) { int no = 0, i ; do { Console.Write("请输入整数:"); i= int.Parse(Console.ReadLine()); no += i; } while (i != 0); Console.Write("和是{0}", no); } }
点击查看答案
第8题
写出下面程序的执行结果。 class Program { static void Main(string[] args) { OnlineGaming onlineGaming = new OnlineGaming("泡泡龙", "小龙","打泡泡"); Console.WriteLine(onlineGaming.ToString()); } } class OnlineGaming { string name; string npc1; string plots; public OnlineGaming(string name, string npc1, string plots) { this.name = name; this.npc1 = npc1; this.plots = plots; } public string ToString() { string s = "网络游戏" + name + "\n情节为" + plots + "\nNPC1" + npc1; return s; } }
点击查看答案
第9题
写出下面程序的执行结果。 class Program { static void Main(string[] args) { b bb = new b("手游", "陈耳东", "章立早"); Console.WriteLine(bb.ToString()); } } class a { public virtual string ToString() { return “”; } } class b:a { private string head; private string member; public b(string name, string head, string member) { this.name = name; this.head = head; this.member = member; } public override string ToString() { return base. ToString() + this.Name+ "社团+社长"+ this.head + "+成员"+this.member+"。"; } }
点击查看答案
第10题
填写代码将下列程序补充完整。 class Program { static void Main(string[] args) { Console.Write("请输入成绩(0~100):"); int score=int.Parse(Console.Readline()); if (score>= 60) Console.Write("恭喜你,通过了!"); (1) Console.Write("很遗憾,需要再考一次!"); } }
点击查看答案
账号:
你好,尊敬的用户
复制账号
发送账号至手机
密码将被重置
获取验证码
发送
温馨提示
该问题答案仅针对搜题卡用户开放,请点击购买搜题卡。
马上购买搜题卡
我已购买搜题卡, 登录账号 继续查看答案
重置密码
确认修改
欢迎分享答案

为鼓励登录用户提交答案,简答题每个月将会抽取一批参与作答的用户给予奖励,具体奖励活动请关注官方微信公众号:简答题

简答题官方微信公众号

警告:系统检测到您的账号存在安全风险

为了保护您的账号安全,请在“简答题”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!

微信搜一搜
简答题
点击打开微信
警告:系统检测到您的账号存在安全风险
抱歉,您的账号因涉嫌违反简答题购买须知被冻结。您可在“简答题”微信公众号中的“官网服务”-“账号解封申请”申请解封,或联系客服
微信搜一搜
简答题
点击打开微信