using System;
class Reftyperectangle
{
public int Width;
public int Height;
}
struct Valtyperectangle
{
public int Width;
public int Height;
}
class Refvaltest
{
public static int Main()
{
Reftyperectangle rec1 = new Reftyperectangle();
rec1.Width = 15;
rec1.Height = 10;
Reftyperectangle rec2 = rec1;
Console.WriteLine(rec2.Width+"*"+rec2.Height);
rec1.Width = 25;
rec1.Height = 20;
Console.WriteLine(rec2.Width + "*" + rec2.Height);
Valtyperectangle rec3 = new Valtyperectangle();
rec3.Width = 10;
rec3.Height = 15;
Valtyperectangle rec4 = rec3;
Console.WriteLine(rec4.Width+"*"+rec4.Height);
rec3.Width=25;
rec3.Height=30;
Console.WriteLine(rec4.Width+"*"+rec4.Height);
Console.ReadLine();
return 0;
}
}
这道题运行结果是 15*10
25*30
15*10
15*10
using System;
class stringexample
{
public static int Main()
{
string s1 = "A string";
string s2= s1;
Console.WriteLine(s1);
Console.WriteLine(s2);
s1="Another string";
Console.WriteLine(s1);
Console.WriteLine(s2);
Console.ReadLine();
return 0;
}
}
这道题运行结果是 A string
A string
Another string
A string
我快晕了
达人快来解释阿