static void Swap( ref int x, ref int y)
{
int temp;
temp = x;
x = y;
y = temp;
}
int m = 2, n = 3;
Console.WriteLine("交换前,两个数{0}和{1}",m,n);
Swap(ref m,ref n);
Console.WriteLine("交换后,两个数{0}和{1}", m,n);
Console.ReadKey();

class Student
{
public string name;
int Score;
public int Score1
{
get {
return Score; }
set {
Score = value;
if (value >= 0 && value <= 100)
{
Score = value;
}
else
Score = -1;
}
}
}
Student stu = new Student();
Console.WriteLine("请输入你的姓名");
stu.name = Console.ReadLine();
Console.WriteLine("请输入你的成绩");
stu.Score1 = int.Parse(Console.ReadLine());
if (stu.Score1 == -1)
{
Console.WriteLine("数据非法");
}
else
{
if (stu.Score1 >= 60 && stu.Score1 <= 100)
{
Console.WriteLine("您通过了考试");
}
else if (stu.Score1 <= 60)
{
Console.WriteLine("未通过了考试");
}
}
Console.ReadKey();
