下列程序段的输出结果为_____。char * s='AAA';s[0]='B';printf('%s',s);
运行错误
举一反三
- 下面程序段中,输出 *的个数是( ) 。 char *s=" a8bc"; for(;*s!=′ \ 0′;s++)printf("*");
- 下列不能输出字符串"Hello"的程序段是______。 A: char *t; t="Hello";printf("%s\n",t); B: char *t, s[]="Hello"; t=s;printf("%s\n",t); C: char s[20],*t=s; t="Hello";printf("%s\n",s); D: char *t, s[]="Hello"; t=s;printf("%s\n",s);
- 以下程序的输出结果是__________ 。 main() { char s[]="abcdef"; s[3]=‘\0'; printf("%s\n",s); }
- 以下程序段的输出结果是( ) char s[]="KvwxyzA"; printf("%d ",strlen(s));
- 以下程序段的输出结果是( ) char s[]="113vwxyzx41"; printf("%dn",strlen(s));
内容
- 0
有下列程序段,程序段运行后的输出结果是( )。 char *s='abcde'; s+=2; printf('%c', *s);
- 1
写出下列程序段的输出结果(栈的元素类型为char)。 void main(){ Stack S; char x,y; InitStack(S); x= ‘c’; y= ‘k’; Push(S,x); Push(S, ‘a’); Push(S,y); Pop(S,x); Push(S, ‘t’); Push(S,x); Pop(S,x); Push(S, ‘s’); while(!StackEmpty(S)) { Pop(S,y); printf(y); } printf(x); }
- 2
有以下程序段,输出结果为()。 #include <stdio.h> struct s { int a; char b; double f; }; main() { printf("%d",sizeof(struct s)); }
- 3
智慧职教: 下列程序段的运行结果是( )。 char s[6];s="abcd"; printf("\"%s\"\n",s);
- 4
若有下列程序段char x[80];scanf(“%s”,x);printf(“%s”,x);从键盘上输入字符串“zhang san”,则输出结果为(