输入一个整数,将各位数字反转后输出,将程序填充完整static void Main(string[] args){Console.WriteLine("请输入一个整数");string x = Console .ReadLine ();int y = int.Parse (x);for(int i=0;i<;x.Length ;i++){Console.Write(y%10);;}}
举一反三
- 读程序写结果.static void Main(string[] args){int X = 0;int Y =X++;Console.WriteLine("Y={0}", Y);Console.WriteLine("X={0}", X);Y = --X;Console.WriteLine("Y={0}", Y);Console.WriteLine("X={0}", X);}程序运行结果为: A: Y=0 B: X=1 C: Y=0 D: X=0
- 以下程序的输出结果是【 】。 class Program { public static void Main(string[] args) { int[] a = new int[3] { 1, 2, 3 }; for (int i = 0; i < 3; i++) Console.Write("{0} ", a[i]); Console.WriteLine(); int[] b = a; for (int i = 0; i < 3; i++) b[i] = 2 * b[i]; for (int i = 0; i < 3; i++) Console.Write("{0} ", a[i]); Console.WriteLine(); Console.Read(); } }[/i][/i][/i][/i]
- 下面程序段输出的结果是什么 class Sample{ static void Swap(ref int x, ref int y) { int tmp; tmp = x; x = y; y = tmp; } static void Main(string[] args) { int a = 30, b = 40; Swap(ref a, ref b); Console.WriteLine("{0},{1}", a, b); Console.ReadKey(); } }
- 请阅读下面的程序 Public class Test { public static void main(String[] args) { int a = 0; int b = 0; for (int i = 1; i <= 5; i++) {
- 下面程序段的运行结果 static void Main(string[] args) { int a = 0; for (int i = 1; i < 5; i++) { int c = 0, b = 2; a += 3; c = a + b; Console.Write(c + ","); } } 程序运行结果是( )