C语言
第861题
有以下程序:
#include <stdio.h>
#include <string.h>
main()
{
char str[12]={'s', 't', 'r', 'I', 'n', 'g'};
printf("%d\n",strlen(str));
}程序运行后的输出结果是()。
第862题
有以下程序:
#include <stdio.h>
main()
{
char s[] = "012xy\08s34f4w2";
int i,n = 0;
for(i = 0;s[i]!='0';i++)
if(s[i]>'0'&& s[i]<='9')n++;
printf("%d\n",n);
}程序运行后的输出结果是()。
第863题
有以下程序:
#include <stdio.h>
main(){
char s[]={"012xy"};
int i,n=0;
for(i=0;s[i]!=0;i++) if(s[i]>='a'&&s[i]<='z')n++;
printf("%d\n",n);
}程序运行后的输出结果是()。
第864题
有以下程序:
#include <stdio.h>
main()
{
char name[10] = {'S','T','R'};
name[2]='#';
name[6]=0;
printf("%s\n",name);
}程序运行后的输出结果是()。
第865题
有如下程序:
#include <stdio.h>
main()
{
char name[10] = {'S','T','R','I','N','G'};
name[3]='E';
name[5]=0;
printf("%s\n",name);
}程序运行后的输出结果是()。
第866题
有以下程序:
#include <stdio.h>
main()
{
int i,j=0;
char a[] = "How are you!",b[10]={0};
for(i=0;a[i];i++)
if(a[i]==' ')
b[j++]=a[i-1];
printf("%s\n",b);
}程序运行后的输出结果是()。
第867题
有以下程序:
#include <stdio.h>
main()
{
int i,j=0;
char a[] = "How are you",b[10]={0};
for(i=0;a[i];i++)
if(a[i]==' ')
b[j++]=a[i+1];
printf("%s\n",b);
}程序运行后的输出结果是()。
第868题
以下选项中正确的语句组是()。
第869题
以下使指针指向一个字符串的选项错误的是()。
第870题
下列语句中,正确的是()。
第871题
以下叙述中正确的是()。
第872题
设有如下程序段:
char s[20]= "Bejing",*p; p=s:
则执行p=s;语句后,以下叙述正确的是()。
第873题
设有定义:char *c;以下选项中能够使字符型指针c正确指向一个字符串的是()。
第874题
有以下说明语句:
char *s = "'Name\\Address\n";
指针s所指字符串的长度是( )。
第875题
若有说明和语句:
char str[]="Hello", *p; p=str;
则此时*(p+5)中的值为()。
第876题
有以下程序:
#include <stdio.h>
main()
{
char s[]="rstuv";
printf("%c\n",*s+2);
}程序运行后的输出结果是()。
第877题
有以下程序
#include <stdio.h>
main()
{
char ch[]="uvwxyz",*pc;
pc=ch;
printf("%c\n",*(pc+5));
}程序运行后的输出结果是()。
第878题
有以下程序(注:字符a的ASCII码值为97):
#include <stdio.h>
main()
{
char *s={"abc"};
do
{
printf("%d",*s%10);
++s;
}while(*s);
}程序运行后的输出结果是()。
第879题
有以下程序:
#include <stdio.h>
main()
{
char s[10] = "verygood", *ps = s;
ps += 4;
ps = "nice";
puts(s);
}程序的运行结果是()。
第880题
有如下程序:
#include <stdio.h>
int disp(char *str)
{
while(*str) putchar(*str++);
return *str;
}
main()
{
printf("%d\n",disp("NAME"));
}程序运行后的输出结果是()。