题目内容 (请给出正确答案)
下列程序的输出结果是() 。using System; namespace aaa { class Example1 { static long sub(int x,int y) { int a = x*x+y*y; return a; } public static void Main() { int a=30; sub(5,2); Console.WriteLine("{0}",a); }
[单选题]

下列程序的输出结果是() 。using System; namespace aaa { class Example1 { static long sub(int x,int y) { int a = x*x+y*y; return a; } public static void Main() { int a=30; sub(5,2); Console.WriteLine("{0}",a); }

A.0

B.29

C.30

D.无定值

提问人:网友肖和成 发布时间:2022-01-07
参考答案
查看官方参考答案
如搜索结果不匹配,请 联系老师 获取答案
网友答案
查看全部
  • · 有4位网友选择 C,占比44.44%
  • · 有2位网友选择 D,占比22.22%
  • · 有2位网友选择 B,占比22.22%
  • · 有1位网友选择 A,占比11.11%
匿名网友 选择了C
[189.***.***.69] 1天前
匿名网友 选择了B
[176.***.***.87] 1天前
匿名网友 选择了A
[239.***.***.151] 1天前
匿名网友 选择了D
[165.***.***.53] 1天前
匿名网友 选择了C
[8.***.***.43] 1天前
匿名网友 选择了D
[42.***.***.113] 1天前
匿名网友 选择了B
[189.***.***.243] 1天前
匿名网友 选择了C
[117.***.***.126] 1天前
匿名网友 选择了C
[57.***.***.192] 1天前
加载更多
提交我的答案
登录提交答案,可赢取奖励机会。
更多“下列程序的输出结果是() 。using System; na…”相关的问题
第1题
顺序执行下面的语句后,输出的结果是______。

public class exl6

{

public static void main(String[] args)

{

int i;

int a[] = new int[10];

for(i = O; i < a.length; i++)

a[i] = i * 10 + j;

for(i = 1; i < a.length; i++)

if(a[i]%5 == O)

System,out.println(a[i]);

}

}

点击查看答案
第2题
下列程序运行的结果是______。   public class Example{   String str=new String("good");   char[]ch={’a’,’b’,’c’};   public static void main(String args[]){   Example ex=new Example();   ex.change(ex.str,ex.ch);   System.out.print(ex.str+" and ");   System.out.print(ex.ch);   }   public void change(String str,char ch[]){   str="test ok";   ch[0]=’g’;   }

A、good and abc

B、good and gbc

C、test ok and abc

D、test ok and gbc

点击查看答案
第3题
下面代码的输出是 class C { public static void main(String[] args) { int x = 1; System.out.print((x > 1) & (x++ > 1)); System.out.print(“ ”); System.out.print((x > 1) && (x++ > 1)); } }

A、false true

B、true false

C、false false

D、true true

点击查看答案
第4题
以下程序的输出结果是()。Usingsystem;ClassExample1{PublicStaticvoidmain(){Inta=5,b=4,c=6,d;Console.Writeline(“{0}”,d=a>b?(a>c?a:c):b);}}

A. 5

B. 4

C. 6

D. 不确定

点击查看答案
第5题
以下程序的输出结果是( )。using System; namespace aaa { public class Person { private int age = 0; public int Age { get { return age; } set { if (value>=18) Console.WriteLine("成年人"); else Console.WriteLine("非成年人"); age = value; } } } public class People:Person { public People() { Console.Write("不得入内"); } } public class Program { public static void Main() { People Shang = new People(); Shang.Age=25; } } }

A、非成年人不得入内

B、成年人不得入内

C、不得入内非成年人

D、不得入内成年人

点击查看答案
第6题
分析以下C#语句,注意类MyClass没有显式指定访问修饰符:namespace aaa { class MyClass { public class subclass { int i; } } } 该类MyClass的默认访问修饰符是( )。

A、private

B、protected

C、internal

D、public

点击查看答案
第7题
已知类MyClass中事件MouseClicked定义如下:public delegate void mydelegate(); public event mydelegate MouseClicked; 执行下列语句:Method obj = new Method(); MyClass e = new MyClass(); e.MouseClicked += obj.fun; e.MouseClicked += obj.fun; 其中Method类中包含事件处理方法fun。然后引发该MouseClicked事件,其结果为( )。

A、obj.fun方法被调用4次

B、obj.fun方法被调用2次

C、obj.fun方法被调用1次

D、obj.fun方法不会被调用

点击查看答案
第8题

用语言描述下面的程序:using System; using System.Collections.Generic; using System.Text; namespace Graph { class Program { static void Main(string[] args) { circular c = new circular(); Console.WriteLine(c.getSides()); square s = new square(); Console.WriteLine(s.getSides()); Graph g; g= new circular(); Console.WriteLine(g.getSides()); g = new square(); Console.WriteLine(g.getSides()); } } public abstract class Graph { public abstract int getSides(); } public class circular : Graph { public override int getSides() { return 1; } } public class square : Graph { public override int getSides() { return 2; } } }

点击查看答案
第9题
int[] a = { 1, 2, 3, 4, 5 }; foreach (int i in a) { … } 在foreach循环中,如果包含( )语句,则会出现错误。

A、i+=2;

B、Console.WriteLine(i+2);

C、int j=i; Console.WriteLine(++j);

D、Console.WriteLine(i>>2);

点击查看答案
第10题
以下定义并初始化一维数组的语句中正确的是( )。

A、int arr1[ ]={6,5,1,2,3};

B、int [ ] arr2=new int[ ];

C、int[ ] arr3=new int[ ]{6,5,1,2,3};

D、int[ ] arr4;arr4={6,5,1,2,3};

点击查看答案
账号:
你好,尊敬的用户
复制账号
发送账号至手机
密码将被重置
获取验证码
发送
温馨提示
该问题答案仅针对搜题卡用户开放,请点击购买搜题卡。
马上购买搜题卡
我已购买搜题卡, 登录账号 继续查看答案
重置密码
确认修改
欢迎分享答案

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

简答题官方微信公众号

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

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

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