计算机二级C语言程序设计
VIP题库
若有以下程序 #include main() { int i,j=0; char a[]="How are you!"; for (i=0; a[i]; i++) if (a[i] != '' '') a[j++]=a[i]; a[j]=''\0''; printf("%s\n",a); }则程序的输出结果是______。
有下列程序#include main(){ char v[4][10] = {"efg","abcd","mnopq","hijkl"};printf("%s,%c,%s,%c", *v,**(v+1),v[3]+3,*(v[2]+1));}程序执行后的输出结果是______。
有以下程序#include main(){ char s1[] = "programe", s2[] = "Language";char *p1 = s1, *p2 = s2;int k;for (k=0; k
有以下程序#include #include main(){ char w[20], a[5][10]={"abcdef", "ghijkl", "mnopq", "rstuv", "wxyz."};int i;for (i=0; i
有以下程序#include #include main(){ char a[20]="ab",b[20]="cdef";int k=0;strcat(a,b);while(a[k]!=''\0'') { b[k]=a[k]; k++;}puts(b);}程序的运行结果是______。
有以下程序main(){ char *p[10]={"abc","aabdfg","dcdbe","abbd","cd"};printf("%d\n",strlen(p[4]));}执行后的结果是______。
有以下程序main(){ char s[]="Yes\n/No",*ps=s;puts(ps+4);*(ps+4)=0;puts(s);}程序运行后的输出结果是______。
有以下程序(其中的strstr()函数头部格式为:char *strstr(char *p1, char *p2) 确定p2字符串是否在p1中出现,并返回p2第一次出现的字符串首地址)#include #include char *a="you";char *b="Welcome you to Beijing!";main(){ char *p;p = strstr(b, a) + strlen(a) + 1;printf("%s\n", p);}程序的运行结果是______。
以下程序中函数scmp的功能是返回形参指针s1和s2所指字符串中较小字符串的首地址。#include #include char *scmp(char*s1,char*s2){ if (strcmp(s1,s2)
有以下程序#include main(){ char w[20], a[5][10]={"abcde", "fghij", "klmno", "pqrst", "uvwxy"};int i;for( i=0; i
«
1
2
...
32
33
34
35
36
37
38
...
149
150
»