您的位置:首页 > 编程语言 > C#

以下C#程序的输出结果是( )。

2016-02-24 10:36 239 查看
以下程序的输出结果是( )。

using System;

namespace HoverTreeTikuConsole
{
class Program
{
static void Main(string[] args)
{
MyStruct s1 = new MyStruct(1, 2);
s1.x = 2;
s1.Sum();
Console.ReadLine();
}
}

/// <summary>
/// http://hovertree.com/h/bjaf/g8bsql7s.htm /// </summary>
struct MyStruct
{
public int x;
public int y;
public MyStruct(int i, int j)
{
x = i;
y = j;
}
public void Sum()
{
int sum = x + y;
Console.WriteLine("the sum is {0}", sum);
}
}


答案:http://hovertree.com/tiku/bjaf/uawcvwwa.htm

http://hovertree.com/tiku/

http://sosoft.cnblogs.com/
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: