更多"以下程序输出的结果为______。 main( ) ch"的相关试题:
[单项选择]以下程序的输出结果是
char cchar(char ch)
if(ch>=’A’&&ch<=’Z’) ch=ch-’A’+’a’;
return ch;
main ( )
char s [] = "ABC+abc=defDEF" , *p=s;
while (*p)
*p=cchar(*p);
p++;
printf "%$/n", s);
A. abc+ABC=DEFdef
B. abc+abc=defdef
C. abcABCDEFdef
D. abcabcdefdef
[单项选择]以下程序的输出结果是
char cchar(char ch)
if(ch>=’A’ &&ch<=’Z’) ch=ch-’A’+’a’;
return ch;
main( )
char s[]="ABC+abc=defDEF",*p=s;
while(*p) *p=cehar(*p);p++;
printf("%s/n",s);
A. abc+ABC=DEFdef
B. abe+abe=defdef
C. abcABCDEFdef
D. abcabcdefdef
[填空题]当运行以下程序时,输入abcd,程序的输出结果是【 】
insert(char str[])
{int i;
i=strlen(str);
while(i>0)
{str[2*i]=str[i];str[ 2*i-1]=’’*’’;i--;}
printf("%S\n",str);
}
main( )
{char str[40];
scanf("%S",str);insert(str);
}
[单项选择]以下程序的输出结果是( )。
main( )
char*s="12134211";
int v[4]=0,0,0,0),k,i;
for(k=0;s[k];k++)
switch(s[k])
case’1’:i=0;
case’2’:i=1;
case’3’:i=2;
case’4’:i=3;
v[i]++:
for(k=0;k<4;k++)printf("%d",v[k]);
A. 4 2 1 1
B. 0 0 0 8
C. 4 6 7 8
D. 8 8 8 8
[填空题]以下程序的输出结果是 【12】 。
main( )
{ char *p=“abodefgh”,*r;
long *q;
q=(long*)p;
q++;
r=(char*)q;
printf(“%s/n”,r);
}
[单项选择]以下程序运行后的输出结果是
void ss(char *s,char t)
while(*s)
if(*s==t) $s=t-’a’+’A’;
s++:
main( )
char str1[20]="abcddfefdbd",c=’d’;
ss(str1,c);
printf("%s/n",str1);
A. ABCDDEFEDBD
B. abcDDfefDbD
C. abcAAfefAbA
D. Abcddfefdbd
[填空题]当运行以下程序时,输入abed,程序的输出结果是: 【9】 。
insert(char str[])
{int i
i=strlen(str);
while(i>0)
{str[2*i]=str[i];str[2*-1]=’*’;i--; }
printf("%s/n",str);
}
main( )
{char str[40];
scanf("%s",sB) ; insert(str);
}
[填空题]当运行以下程序时,输入abcd,程序的输出结果是 【19】 。
insert(char str[ ] )
int i;
i = stolen(str);
while (i>0)
str[2*i] =str[i]; str[2 * i-1] = ’* ’; i--;
printf( "% s /n", sir);main( )
char str[40];
seanf( "% s" ,str); insert(str);
[填空题]以下程序的输出结果是 [10] 。
char s[ ]="XYZQ";
void main( ){
char *p;
for(p = s; p < s+4; p++)
cout<<p<<end1;
}
[填空题]以下程序的输出结果是 【6】 。
main( )
{ char c=’z’;
printf("%c",c-25);}
[单项选择]以下程序输出结果为( )。
class test 2
public static void main(String args[])
int n=7;
n<<=3;
n=n&n+1 |n+2^n+3;
n>>=2;
System.out.println(n);
A. 0
B. -1
C. 14
D. 64
[单项选择]以下程序输出结果为( )。
class test 2
public static void main(String args[])
int n = 7;
n<<=3;
n=n&n+1|1n+2^n+3;
n>>=2;
System.out.println(n);
A. 0
B. -1
C. 14
D. 64
[填空题]以下程序的输出结果是______。
#include
main( )
char *ch[4]=("red ","green","blue");
int i=0;
while(ch[i])
putchar(ch[i][0]);i++;
[填空题]以下程序的输出结果是______。
#include
#include
char *fun(char *t)
char *p=t;
return (p+strlen(t)/2);main( )
char *str="abcdefgh";
str=fun(str);
puts(str);
[填空题]以下程序的输出结果是 【13】 。
main( )
{ char s[]=“abcdef”;
s[3]=’/0’;
printf(“%s/n”,s);
}