新手提问,各位大哥大姐帮忙看看怎么回事! 谢谢!
最后的数值怎么交换不过来? 在线等!
using System;
class Program
{
private static void change(int a, int b)
{
int c;
c = a;
a = b;
b = c;
}
private static void Main(string[] args)
{
Console.WriteLine("please input a:");
int a=Convert.ToInt16( Console.ReadLine());
Console.WriteLine("please input b:");
int b=Convert.ToInt16( Console.ReadLine());
change(a,b);
Console.WriteLine("a={0},b={1}",a,b);
}
}
[此贴子已经被作者于2007-3-23 10:12:03编辑过]