更多"阅读下列程序段,程序的输出结果为( )。 #include <st"的相关试题:
[单项选择]阅读下列程序段,程序的输出结果为
#include "stdio.h"
#define M(X,Y) (X)*(Y)
#define N(X,Y) (X)/(Y)
main( )
int a=5,b=6,c=8,k;
k=N(M(a,b),c);
printf("%d/n",k);
A. 3
B. 5
C. 6
D. 8
[单项选择]阅读下列程序段,则程序的输出结果为
#include "stdio.h"
#define M(X,Y)(X)*(Y)
#define N(X,Y)(X)/(Y)
main( )
int a=5,b=6,c=8,k;
k=N(M(a,b),c);
printf("%d/n",k);
A. 3
B. 5
C. 6
D. 8
[单项选择]阅读下列程序段,则程序的输出结果为()
#include "stdio.h"
#define M(X,Y)(X)*(Y)
#define N(X,Y)(X)/(Y)
main( )
int a=5,b=6,c=8,k;
k=N(M(a,b),c);
printf("%d/n",k);
A. 3
B. 5
C. 6
D. 8
[单项选择]以下程序段的输出结果是( )。
#include<stdio.h>
#define MIN(x,y)(x)<(y)(x):(y)
void main( )
int i,j,k;
i=10; j=15;
k=10*MIN(i,j);
printf("%d/n",k),
A. 15
B. 100
C. 10
D. 150
[单项选择]下面程序段的输出结果是( )。
publicclassTest
publicstaticvoidmain(Stringargs[])
intx,y;
x=(int)Math.sqrt(5)/2+(int)Math.random( )*5/2;
Y=(int)Math.sqrt(3)/2+(int)Math.random( )*3/2;
if(x>y)
System.out.println9"x>y");
elseif(x==y)
System.out.println("x=y");
else
System.out.println("x<y");
A. x>y
B. x=y
C. x<y
D. 编译错误
[单项选择]下面程序段的输出结果为
public class MyClass
public static void main(String args[])
String s="Hello! How are you";
System.out.println(s.LastIndexOf("o",16);
A. 16
B. o
C. u
D. 17
[单项选择]下面程序段的输出结果为
public class MyClass
public static void main(String args[])
String s="Helto! How are you";
System.out.println(s.lastlndexOf("o",16));
A. 16
B. o
C. u
D. 17
[单项选择]下面程序段的输出结果是
public class Test
public static void main(String args[])
int[] a=new int[11];
int[] p=new int[4];
int k=5;
for(int i=1;i<=10;i++)
a[i]=i;
for(int i=l;i<=3;i++)
p[i]=a[i*i];
for(int i=1;i<=3;i++)
k=k+p[i]*2;
System.out.println(k);
A. 37
B. 31
C. 33
D. 35
[单项选择]下面程序段的输出结果为
public class Test
public static void main(String args[])
boolean a,b,c;
a=(3<5);
b=(a==true);
System.out.println(”a=”+a+”b=+b) ;
c=(b==false);
System.out.printhln(”b=”+b+”c=”+c) ;
A. a=true b=false
B. a=true b=false
C. a=true b=true
D. a=false b=false
[单项选择]下面程序段的输出结果是
public class Test
public static void main(String args[])
int[]a=new int[11];
int[]p=new int[4];
int k=5;
for(int i=1;i<=10;i++)
a[i]=i;
for(int i=1;i<=3;i++)
p[i]=a[i*i]
for(int i=1;i<=3;i++)
k=k+p[i]*2;
System.out.println(k);
A. 37
B. 31
C. 33
D. 35
[单项选择]下列程序段的输出结果是( )。
void doublearithmaticoperator( )
int a=10,b=4,c=20,d=6;
System.out.print(a+b*c+d);
System.out.print(",");
System.out.print(a+c%b);
System.out.print(",");
System.out.println(a++*b+c*-d);
A. 860,10,360
B. 96,10,140
C. 96,13,140
D. 860,13,360
[单项选择]下面程序段的输出结果为( )。 packagetest; publicclassClassA { intx=20; staticinty=6; publicstaticvoidmain(Stringargs[]) { ClassBb=newClassB( ); b.go(10); System.out.println("x="+b.x); } } classClassB { intX; voidgo(inty) { ClassAa=newClassA( ); X=a.y; } }
A. x=10
B. x=20
C. x=6
D. 编译不通过