相关题目
有以下程序
#include "stdio.h"
#include "string.h"
void main( )
{ char str[100] ="How do you do";
strcpy( str + strlen(str)/2, "es she");
printf("%s\n", str);
}
执行后的输出结果是( )。
有以下程序
#include "stdio.h"
f(char *s)
{ char *p=s;
while(*p!='\0')
p++;
return(p-s);
}
void main()
{ printf("%d\n",f("ABCDEF"));
}
执行后的输出结果是( )。
有以下程序
#include "stdio.h"
#include "string.h"
void main( )
{ char s1[50]={"some string *"},s2[]={"test"};
printf("%s\n", strcat(s1,s2));
}
执行后的输出结果是( )。
有以下程序
#include "stdio.h"
void main( )
{ int a[4][5]={1,2,4,-4,5,-9,3,6,-3,2,7,8,4};
int i,j,n;
n=9;
i=n/5;
j=n-i*5-1;
printf("a[%d][%d]=%d\n", i,j,a[i][j]);
}
执行后的输出结果是( )。
有以下程序
#include
void main()
{
int s,i,sum();
for (i=1;i<=10;i++)
s=sum(i);
printf("s=%d\n",s);
}
sum(int k)
{
int x=0;
return (x+=k);
}
程序运行后的输出结果是 ( )。
有以下程序
#include
void main()
{
int a[][2]={10,20,30,40,50,60},(*p)[2];
p=a;
printf("%d\n",*(*(p+2)+1));
}
程序运行后的输出结果是 ( )。
有以下程序
#include
void fun(char *c)
{ while(*c)
{ if(*c>='a'&&*c<='z') *c=*c-('a'-'A');
c++;
}
}
void main()
{ char s[81];
gets(s); fun(s); puts(s):
}
当执行程序时从键盘上输入Hello Beijing<回车>,则程序的输出结果是( )。
有以下程序(说明:字母A的ASCII码值是65,
#include
void fun(char *s)
{ while(*s)
{ if(*s%2) printf("%c",*s);
s++;
}
}
void main()
{ char a[]="BYTE";
fun(a); printf("\n");
}
程序运行后的输出结果是 ( )。
有以下程序
#include
void main()
{ int s;
scanf("%d",&s);
while(s>0)
{ switch(s)
{ case 1:printf("%d",s+5);
case 2:printf("%d",s+4); break;
case 3:printf("%d",s+3);
default:printf("%d",s+1);break;
}
scanf("%d",&s);
}
}
运行时,若输入1 2 3 4 5 0<回车>,则输出结果是( )。
#include
void main()
{
char str[]="\"stop!\",he said";
printf(str);
}
程序的运行结果是 ( )。
