网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

有以下程序

#include<stdio.h>

#include<string.h>

void fun(char *w,int m)

{ char s,*p1,*p2;

p1=w;p2=w+m-1;

while(p1<p2){s=*p1;*p1=*p2;*p2=s;p1++;p2--;}

}

main()

{ char a[]="123456";

fun(a,strlen(a));puts(a);

}

程序运行后的输出结果是

A.654321

B.116611

C.161616

D.123456


参考答案

更多 “ 有以下程序#includestdio.h#includestring.hvoid fun(char *w,int m){ char s,*p1,*p2;p1=w;p2=w+m-1;while(p1p2){s=*p1;*p1=*p2;*p2=s;p1++;p2--;}}main(){ char a[]="123456";fun(a,strlen(a));puts(a);}程序运行后的输出结果是A.654321B.116611C.161616D.123456 ” 相关考题
考题 设有以下函数void fun(int n,char * s) { …… }则下面对函数指针的定义和赋值均是正确的是A)void (*pf)(); pf=fun;B)viod *pf(); pf=fun;C)void *pf(); *pf=fun;D)void (*pf)(int,char);pf=fun;

考题 有以下程序:includevoid fun(char**p){++P;printf("%s\n",*p);}main()char*a[]={"Morn 有以下程序: #include<stdio.h> void fun(char**p) { ++P;printf("%s\n",*p);} main() char*a[]={"Morning","Afternoon","Evening","Night"}; fun(A); } 程序的运行结果是( )。A.AfternoonB.fternoonC.MorningD.oring

考题 有以下程序 include void fun(char **p) { ++p; printf("%s\n",*p); 有以下程序 #include <stdio.h> void fun(char **p) { ++p; printf("%s\n",*p); } main() { char *a[]={"Moming","Afternoon","Evening","Night"}; fun(a); } 程序的运行结果是A.AfternoonB.fternoonC.MorningD.orning

考题 以下程序的输出结果是______。includeincludefun(char*w,int n){ char t,*s 以下程序的输出结果是______。 #include<stdio.h> #include<string.h> fun(char*w,int n) { char t,*s1,*s2; s1=w;s2=w+n-1; while(s1<s2) { t=*s1++; *s1=*s2-; *s2=t; } } main() { char*p; p="1234567"; fun(p,strlen(p)); puts(p); }A.1234567B.7654321C.1711717D.7177171

考题 以下程序的输出结果是______。includeincludefun(char *w,int n){ char t,* 以下程序的输出结果是______。 #include<stdio.h> #include<siring.h> fun(char *w,int n) { char t,*s1,*s2; s1=w;s2=w+n-1; while(s1<s2) { t=*s1++; *s1=*s2-; *s2=t; } } main() { char *p; p="1234567"; fun(p,strlen(p)); puts(p); }A.1234567B.7654321C.1711717D.7177171

考题 设有以下函数: void fun(int n,char*s){…} 则下面对函数指针的定义和赋值均正确的是( )。A.void(*pf)( );pf=fun;B.void*pf( );pf=funC.void*pf( );*pf=fun;D.void(*pf)(int,char);pf=fun;

考题 下列程序运行后,输出结果是______。 include include fun(char *w ,int 下列程序运行后,输出结果是______。 #include <stdio. h> #include <string. h> fun (char *w ,int n) { char t,*s1,*s2; s1=w; s2=w+n-1; while (s1<s2) { t=*s1++; *s1=*s2--; *s2=t; } } main () { char *p; p="1234567"; fun (p, strlen (p)); puts (p); }A.1234567B.7654321C.1711717D.7177171

考题 设有以下函数:void fun(int n,char*$s){……}则下面对函数指针的定义和赋值均正确的是A.void(*pf)( );pf=fun;B.void*Pf( );pf=fun;C.void*pf( ); *pf=fun;D.void(*pf)(int,char);nf=fun;

考题 设有以下函数:voidfun(intn,char}s){……}则下面对函数指针的定义和赋值均正确的是( )。A.void(*pf)(int,char);pf=fun;B.void+pf( );pf=fun;C.void*pf( );*pf=fun;D.void(*pf)(int,char*);pf=fun;

考题 以下程序的输出结果是_______。includeincludefun(char*w,int n){char t,*s 以下程序的输出结果是_______。 #include<stdio.h> #include<string.h> fun(char*w,int n) { char t,*s1,*s2; s1=w;s2=w+n-1; while(s1<s2) { t=*s1++: *sl=*s2-; *s2=t; } } main() { char*p; p="1234567"; fun(p,strlen(p)); puts(p); }A.1234567B.7654321C.1711717D.7177171