下面程序的运行结果是?public static void main(String[] args) { int x = 8; int y = 4; if(x++>8 && ++y<4){ System.out.print(x); }else{ System.out.print(y); } System.out.printf("%d%d",x,y);}
A: 995
B: 985
C: 494
D: 495
A: 995
B: 985
C: 494
D: 495
举一反三
- using System; class Test { public static void Main() { int x = 5; int y = x++; Console.WriteLine(y); y=++x; Console.WriteLine(y); } }
- 分析以下C#代码,其运行结果是______ using System;class Test{ public static void Main() { int x = 5; int y = x++; y=++x; Console.Write (y); }}
- 下列程序的运行结果是______。 public class Test { public static void main (String[] args) { int x=3, y=4, z=5; if (x>3) { if (y<2) System.out.print ("show one"); else System.out.print ("show two"); } else{ if (z>4) System.out.print ("show three"); else System.out.print ("show four"); } } } A: show one B: show two C: show three D: show four
- 写出以下程序的运行结果。using System;class Test{public static void Main(){int x = 5;int y = x++;Console.WriteLine(y);//第1空y=++x;Console.WriteLine(y);//第2空}}
- 读程序写结果.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