更多"#include'stdio.h' char*fun(s,c) c"的相关试题:
[填空题]
[程序]
#include
int fun(char *s)
{
char *p=s;
while(*p) p++;
return(p-s);
}
void main(void)
{
char s1[]={"China"},s2[]={"Apple/nPear/tCat/0Bye"};
cout<
cout<
}
执行以上程序后输出的第一行是 () ,第二行是 () 。
[单项选择]有以下程序
#include
#include
void fun(char *s[ ],int n)
char *t; int i,j;
for(i=0; i<N-1;&NBSP;i++)&NBSP;
for(j=i+1; j<N;&NBSP;j++)&NBSP;
if(strlen(s[i])>strlen(s[j])) t=s[i]; s[i]=s[j]; s[j]=t;main( )
char *ss[]="bcc","bbcc","xy","aaaacc","aabcc";
fun(ss,5); printf("%s,%s/n",ss[0],ss[4]);程序的运行结果是______。
A. xy,aaaacc
B. aaaacc,xy
C. bcc,aabcc
D. aabcc,bcc
[单项选择]请读程序:
# include<stdio.h>
Char fun(char*c)
(if(c<=’z’& & * c>=’A’) * c-=’A’-’a’
return * c;
main( )
char s[81],* p=s;
gets(s);
while(* p)
* p=fun(p);putchar(* p);p + +;
puchar(’/n’);
若运行时从键盘上输入OPEN THE DOOR <CR>(<CR>表示回车),则上面程序的输出结果是 ( )
A. oPEN tHE dOOR
B. ope the door
C. OPEN THE DOOR
D. Open The Door
[单项选择]有以下程序:
#include <stdio.h>
char fun(char x,char y)
if(x<y) return x;
return y;
main( )
int a='9',b='8',c='7';
printf("%c/n",fun(fun(a,b),fun(b,c)));
程序的执行结果是( )。
A. 函数调用出错
B. 8
C. 9
D. 7
[单项选择]
有以下程序
#include
void fun(char *c,int d)
{*c=*c+1;d=d+1;
printf("%c,%c,",*c,d);
main( )
{char b=’a’,a=’A’;
fun(&b,a);printf("%e,%e/n",b,a);
}
程序运行后的输出结果是()
A. b,B,b,A
B. b,B,B,A
C. a,B,B,a
D. a,B,a,B
[单项选择]有以下程序:
#include<stdio.h>
char fun(char x, char y)
if(x<y) return x;
return y;
main( )
int a='9', 'b='8', c='7';
printf("%c/n", fun(fun(a, b), fun(b, c) ) );
程序的执行结果是( )。
A. 函数调用出错
B. 8
C. 9
D. 7
[填空题]以下程序运行后的输出结果是______。
#include
char*ss(char*s)
char*p,t;
P=s+1;t=*s;
while(*p) *(p-1)=*p;p++;
*(p-1)=t;
return s;
main( )
char*p,str[10]="abcdefgh";
p=ss(str);
printf("%s/n",p);
[填空题]
有以下程序
#include
#include
void fun(char *str)
{ char temp;int n,i;
n=strlen(str);
temp=str[n-1];
for(i=n-1;i>0;i--) str[i]=str[i-1];
str[0]=temp;
}
main( )
{ char s[50];
scanf("%s",s); fun(s); printf("%s/n",s);}
程序运行后输入:abcdef<回车>,则输出结果是 () 。
[填空题]以下程序运行后的输出结果是______。
#include
void fun(char *s,int p,int k)
int i;
for(i=p;i<K-1;i++)&NBSP;S[I]=S[I+2]; main( )
char s[]="abcdefg";
fun(s,3,strlen(s)); puts(s);
[单项选择]有以下程序
#include
#include
void fun(char *w, int m)
{ char s, *p1, *p2;
p1=w; p2=w+m-1;
while(p1A. 654321
B. 116611
C. 161616
D. 123456
[填空题]
以下程序运行后的输出结果是_________。
#include
void fun(char *s,int p,int k)
{ int i;
for(i=p;i}
main( )
{ char s[]="abcdefg";
fun(s,3,strlen(s)); puts(s);
}
[单项选择]程序中若有如下说明和定义语句
char fun(char *);
main( )
char *s="one",a[5]=0,(*f1)( )=fun,ch;
…以下选项中对函数fun的正确调用语句是()。
A. (*f1);
B. *f1(*s);
C. fun(&a);
D. ch=*f1(s);
[填空题]#include<stdio.h>
int fun(char*s)
{char*p=s;
while(*p!=’/0’)p++;
return(p-s);}
main( )
{printf("%d/n",fun("hello world"));
}
程序运行结果是:______
[单项选择]有以下程序:
#include<stdio.h>
void fun(char*t,char*s)
while(*t!=0)t++;
while((*t++=*s++)!=0);
main( )
char ss[10]="acc",aa[10]="bbxxyy";
fun(ss,aa);printf("%s,%s/n",ss,aa);
程序的运行结果是______。
A. accxyy,bbxxyy B) acc,bbxxyy C) accxxyy,bbxxyy D) accbbxxyy,bbxxyy
[单项选择]有以下程序
#include
#include
void fun(char s[][10], int n)
char t; int i,j;
for(i=0;i<N-1;i++)
for(j=i+1;j<N;j++)
/*比较字符串的首字符大小,并交换字符串的首字符*/
if(s[i][0]>s[j][0]) t=s[i][0]; s[i][0]=s[j][0]; s[j][0]=t;main( )
char s[5][10]="bcc","bbcc","xy","aaaacc","aabcc";
fun(ss,5); printf("%s,%s/n", ss[0],ss[4]);程序的运行结果是()。
A. xy,aaaacc
B. aaaacc,xy
C. xcc,aabcc
D. acc,xabcc