填空题
以下程序的输出结果是
【14】
。
main()
int x=0;
sub(&x,8,1);
printf("%d\n",x);
sub(int *a,int n,int k)
if(k<=n)sub(a,n/2,2*k);
*a+=k;
【参考答案】
G
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
填空题
以下程序中函数huiwen的功能是检查一个字符串是否是回文,当字符串是回文时,函数返回字符串: yes!,否则函数返回字符串:no!,并在主函数中输出。所谓回文即正向与反向的拼写都一样,例如:adgda。请填空。 #include <string.h> char*huiwen(char *str) char *p1,*p2; int i,t=0; p1=str;p2= 【18】 ; for(i=0;i<=strlen(str) 2;i++) if(*p1++!=*p2--)t=1;bteak; if( 【19】 )return( yes! ); else return( no! ); main() char sb[50]; printf( Input: ); scanf( %s ,str); ptintf( %s n , 【20】 );
点击查看答案&解析
填空题
下列程序中的函数stropy2()实现字符串两次复制,即将t所指字符串复制两次到s所指内存空间中,合并形成一个新字符串。例如,若t所指字符串为:efgh,调用strcpy2后,s所指字符串为:efghefgh。请填空。 #include <stdio.h> #include <string.h> void strcpy2(char *s,char *t) char *p=t; while(*s++=*t++); s= 【15】 ; while( 【16】 =*p++); main() char str1[100]= abed ,str2[]= efgh ; strcpy2(str1,str2); printf( %s n ,str1);
点击查看答案&解析
相关试题
以下程序中,for循环体执行的次数是 【1...
以下函数fun的功能是返回str所指字符串中以...