以下程序段的输出结果为( )。 main() { char x='A'; x=(x>='A'&&x<='Z')?(x+32):x; printf("%c\n",x); }
A.A
B.a
C.Z
D.z
A.A
B.a
C.Z
D.z
以下程序段的输出结果为_____。 class Cruncher{ void crunch(int i) { System.out.println("int"); } void crunch(String s){ System.out.println("String"); } public static void main(String args[]){ Cruncher crun=new Cruncher(); char ch="p": crun.crunch(ch); } }
A.a=2,b=1
B.a=1,b=1
C.a=1,b=0
D.a=2,b=2
执行下面的程序段,输出结果为【 】。 public class Q { public Static Void main(String args[]) { int anar[]=new int[5]; System.out.println(anar[0]); } }
下列程序段的输出结果为【 】。 public class Test { void printValue(int m) { do { Systern.out,println("The value is "+m); } while(-m>10); } public static void main(String arg[]){ int i=10; Test t=new Test(); t.print Value(i); } }
写出下列程序段的输出结果(栈的元素类型SElemType为char)。
void main()
{
Stack S;
char x,y;
lnitStack(S);
x='c';
y='k';
Push(S,x);
Push(S,'a');
Push(S,y);
Pop(S,x);
Push(S,'t');
Push(S,x);
Pop(S,x);
Push(S,'s');
While(!StackEmpty(S))
{
Pop(S,y);
printf(y);
}
printf(x);
}
以下程序的输出结果为【 】。 define JFT(x)x*x main() { int a, k=3; a =++ JFT(k+1); printf("%d",a); }
以下程序的输出结果为__________。 public class Short { public static void main (String args[ ]) { String Buffer s=new StringBuffer("Boy"); if ((s.length()<3)& &(s.append("男孩").equals("False"))) ; System.out.println("结果为:"+ s); } }
以下程序的输出结果为【 】。 main() { int k=1; white(k<=15) if(k%3!=2)continue; else printf("%d ",k); printf("\n"); }
以下程序执行后的输出结果为______。
main ()
{ int a=4,b=3,c=5,t=0;
if(a<b) {t=a;a=b;b=t;}
if(a<c) {t=a;a=c;c=t;}
printf("%d %d %d\n",a,b,c);
}
A.x+y+z=48
B.x+y+z=35
C.x+z=35
D.不确定