相关题目
#include "stdio.h"
void main( )
{ char str[80];
scanf("%s",str);
insert(str);
}
insert(char s[])
{
int i;
for(i=strlen(s);i>0;i--)
{ s[2*i]=s[i];
s[2*i-1]=' ';
}
printf("%s",s);
}
如果输入的字符串是abcd, 则程序的运行结果是 ( ) 。
#include "stdio.h"
int digits(int n)
{
int c=0;
do {
c++;
n/=10;
}while(n);
return c;
}
void main( )
{
printf("%d",digits(824));
}
程序运行结果是 ( ) 。
#include
void disp(char *string)
{
if(*string)
{
disp( string+1);
putchar (*string);
}
}
void main()
{
disp("abcdefg");
}
程序的运行结果是( )。
#include "stdio.h"
void main()
{
int a=2,i=0,tn=0,sn=0;
while(i<3)
{
tn=tn+a;
sn=sn+tn;
a=a*10;
i++;
}
printf("%d",sn);
}
程序的运行结果是( )。
要使下列程序的输出结果是字符A,则下划线处应填 ( ) 。
main()
{
char x='b';
int i=0;
do{
--x;
}while( _____ );
printf("%c",x);
}
下列程序执行后的输出结果是( )。 #include "stdio.h"
void main()
{
int i;
for(i=1;i+1;i++)
{
if(i>4)
{ printf("%d\n",i);
break;
}
printf("%d\n",i++);
}
}
下列程序执行后的输出结果是( )。 #include "stdio.h"
void main()
{
int a=-1,b=1,k;
if((++a<0)&&!(b--<=0))
printf("%d,%d\n",a,b);
else
printf("%d,%d\n",b,a);
}
下面的程序段运行后,输出结果是 ( )。
int i,j,x=0;
static int a[8][8];
for(i=0;i<3;i++)
for(j=0;j<3;j++)
a[i][j]=2*i+j;
for(i=0;i<8;i++)
x+=a[i][j];
printf("%d",x);
对于下述程序,在方式串分别采用"wt"和"wb"运行时,两次生成的文件TEST的长度分别是( )。
#include
void main()
{ FILE *fp=fopen("TEST",);
fputc(′A′,fp);fputc(′\n′,fp);
fputc(′B′,fp);fputc(′\n′,fp);
fputc(′C′,fp);
fclose(fp); }
有以下程序
#include
main()
{ char p[]={′a′, ′b′, ′c′},q[10]={ ′a′, ′b′, ′c′};
printf("%d%d\n",strlen(p),strlen(q));}
以下叙述中正确的是 ( )。
