计算机二级C语言程序设计
VIP题库
下列选项中,能够满足"若字符串s1等于字符串s2,则执行ST"要求的是______。
有下列程序#include main(){ int i,j=0;char a[]="abl23c4d56ef7gh89";for(i=0; a[i]; i++)if(!(a[i] >= ''0'' && a[i]
若有以下程序 #include char *a="you"; char b[ ]="Welcome you to China!"; main() { int i, j=0; char *p; for ( i=0; b[i] !=''\0''; i++ ) { if (*a == b[i]) { p=a; for (j=i; *p!=''\0''; j++) { if (*p != b[j]) break; p++; } if (*p==''\0'') break; } } printf("%s", &b[i]);}则程序的输出结果是______。
有以下程序 #include void fun(char *a,char *b){ char *s=a;while(*s) s++;s--;while(s>=a){ *b=*s; s--; b++; }*b=''\0'';}main(){ char s1[]="abc",s2[6];fun(s1,s2);puts(s2);}程序运行后的输出结果是______。
有以下程序#include main(){ char *mm[4]={"abcd","1234","mnop","5678"};char **pm=mm;int i;for(i=0; i
设有定义:char *c;,以下选项中能够使字符型指针c正确指向一个字符串的是______。
有以下程序#include #include void fun ( char *s ){char a[10];strcpy( a, "STRING" );s = a;}main(){char *p="PROGRAM";fun( p );printf("%s\n",p);}程序运行后的输出结果是(此处□代表空格) ______。
有下列程序#include #include main(){ char v[4][10], *p[4], *t;int i,j;for (i=0; i
若有以下程序 #include char *a="you", b[ ]="welcome#you#to#China!"; main() { int i,j=0; char *p; for ( i=0; b[i]!=''\0''; i++ ) { if (*a == b[i]) { p=&b[i]; for (j=0; a[j]!=''\0''; j++) { if (a[j] != *p) break; p++; } if (a[j]==''\0'') break; } } printf("%s\n", p); }则程序的输出结果是______。
以下程序中函数f的功能是将n个字符串,按由大到小的顺序进行排序。#include void f(char p[][10],int n){ char t[20]; int i,j;for(i=0;i
«
1
2
...
38
39
40
41
42
43
44
...
149
150
»