更多"下面程序的输出结果是______。 main( ) static"的相关试题:
[填空题]下面程序的输出结果是______。
main( )
{ static char a[]="language",b[]="program";
char *ptrl=a,*ptr2=b;
int k
for(k=0;k<7;k++)
if(*(ptrl+k)==*(ptr2+k))
printf("%c",*(ptr1+k));}
[单项选择]下面程序段的输出结果是
classTest
public static void main(Stringargs[])
MyThread t=new MyThread( );
t.displayOutput(”t has been createD) ”);
t.start( );
Class MyThread extends Thread
public void displayOutput(Strings)
System.out.println(S);
public void run( )
displayOutput(”t is running.”);
A. thas been created.
B. thas been created
C. t is running.
D. 编译出错
[单项选择]下面程序段的输出结果是 class Test{ public static void main(String args[]){ MyThread t=new MyThread( ); t.displayOutput("t has been createD) "; t.start( ); } } class MyThread extends Thread{ public void displayOutput(String s){ System.out.println(s); } public void nm( ){ displayOutput("t is running. "); }
A. t has been create t is runnin
B. t has been create
C. t is runnin
D. 编译出错
[填空题]执行下面程序段时输出suet,请填空。
main( )
{ static char a[]="student";
char *p;
for(p=a;p< 【8】 ;p+=2)
putchar(*p);
}
[填空题]执行下面程序段时输出suet,请填空。
main( )
static char a[]="student";
char *p;
for(p=a;p< 【8】 ;p+=2)
putchar(*p);
[填空题]下面程序的输出结果是 【13】 。
char b[]="ABCD";
main( )
char *chp;
for (chp=b;*chp ;chp +=2) printf("%s",chp);
printf("/n");
[填空题]下面程序的输出结果是 【12】 。
char b[]="ABCD";
main( )
char b[30];
strcpy(&b[0],"GH");
strcpy(&b[1],"GH");
strcpy(&b[2],"GH");
printf("%s/n",b);
[单项选择]下面程序的输出结果是 ( )
maint( )
char * s="121";
int k=0,a=0,b=0;
do
k + +;
if (k%2==0)
a=a + s[k]-’0’;continue;
b=b + s[k]-’0’;a=a + s[k]-’0’
wnile(s[k+1]);
printf("k=%d a=%d b=%d/n",k,a,b);
A. k=3 a=2 b=3
B. k=3 a=3 b=2
C. k=2 a=3 b=3
D. k=2 a=2 b=3
[单项选择]下面程序的输出结果是()。
#include<stdio.h>
main( )
char a[]=’a’,’b’,’c’,’d’,’f’,’g’,*p;
p=a;
printf("%c/n",*p+4);
A. a
B. b
C. e
D. f
[填空题]下面程序的输出结果是 【12】 。
char b[]="ABCD";
main( )
char *p=b;
for(;*p;p++)
printf("%s",p);
printf("/n");
[填空题]下面程序的输出结果是 【12】 。
char b[]="ABCD";
main( )
char b[30];
strcpy(&b[0],"GH");
strcpy(&b[1],"GH”);
strcpy(&b[2],"GH");
printf("%s/n",B) ;