• 2022-06-14
    下面程序的运行结果是?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
  • C

    内容

    • 0

      写出下面程序运行结果。 public class Demo { public static void main(String args[]) { int x = 9, y = 11, z = 8; int t, w; t = x > y ? x : y + x; w = t > z ? t : z; System.out.println(w); } }

    • 1

      有以下程序void f( int y,int *x){y=y+*x; *x=*x+y;}main( ){ int x=2,y=4; f(y,&x); printf(“%d %d ”,x,y);} 执行后输出的结果是 A: 8 4 B: 4 2 C: 2 4 D: 4 8

    • 2

      (06-03)在Java中,以下程序编译运行后的输出结果为( )。 public class Test { int x, y; Test(int x, int y) { this.x = x; this.y = y; } public static void main(String[] args) { Test pt1, pt2; pt1 = new Test(3, 3); pt2 = new Test(4, 4); System.out.print(pt1.x + pt2.x); } }

    • 3

      1. 写出以下程序的运行结果。 class Test { public static void Main() { int x = 5; int y = x++; Console.WriteLine(y); y=++x; Console.WriteLine(y); Console.WriteLine(x); } } 运行结果:

    • 4

      阅读下面的程序 public class Test { public static void main(String&#91;&#93; args) { for(int x = 0 ; x <=3 ; x++){ continue; System.out.print(x%2); } } }