有以下程序: #include<stdio.h> #include<string.h> #include void f(char*s,char*t) { char k; k=*s; *s=*t; *t=k; s++;t--; if(*s)f(s,t): } main() {char str[10]="abcdefg",*P; P=str+strlen(str)/2+1: f(p,p-2); printf("%s\n",str); } 程序运行后的输出结果是( )。
A.abcdefg
B.gfedcba
C.gbcdefa
D.abedcfg
对下述程序的判断中,正确的是( )。 #include<stdio.h> void main() {char *P,s[256]; p=s; while(strcmp(s,"the end")) {printf("Input the string:"); gets(s); while(*P) putchar(*p++);}}
A.此程序循环接收字符串并输出,直到接收到字符串“the end”为止
B.此程序循环接收字符串,接收到字符串“the end”则输出,否则程序终止
C.此程序循环接收字符串并输出,直到接收字符串“the end”为止,但因为代码有错误,程序不能正常工作
D.此程序循环接收字符串并将其连接在一起,直到接收字符串“the end”为止,输出连接在一起的字符串
下列程序的输出结果是______。# include<stdio.h>f(char 8s){ char *p=s; while(*p!='\0')p++; return(p-s);}main(){ printf("%d\n",f("ABCDEF"));}
A.3
B.6
C.8
D.0
以下程序的输出结果是( )。 #include <stdio.h> charcchar(char eh) { if(ch>='A,&&ch<='Z') ch=ch-'A'+'a'; return ch; } main() { char s[]="ABC+abc=defDEF",*p=s; while(*p) { *p=cchsr(*p); p++; } printf("%s\n",s); }
A.abc+ABC=DEFdef
B.abc+abc=defdef
C.abcABCDEFdef
D.abcabcdefdef
有以下程序 并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[]="1234567"; fun(p,strlen(p)); puts(p); } 程序运行后的输出结果是( )
A.1234567
B.7654321
C.1711717
D.7177171
摘要:朝鲜韩国的政治与对外关系网课答案问:对下述程序的判断中,正确的是().#include"stdio.h"voidmain(){char*p,s[128];p=s;while(strcmp(s,"End"))串:");gets(s);while(*p){printf("请输入一个字符putchar(*p++);}}答:此程序循环接收字符串并输出,直到接收字符串"End"为止问:若有定义和语句int*point,a=4;point=&a;下面均代表地址的一组选项是().答:&a,&*point,point问:现有如下定义:inta,b,*p,*q;,则下列赋值语句错误的是().答:p=a;问:有以下程序voidfun(char*t,char*s){while(*t!=0)t++;while((*t++=*s++)!=0);}main(){charss[10]="acc",aa[10]="bbxxyy";fun(ss,aa);printf("%s,%s\n",ss,aa);}程序的运行结果是().答:accbbxxyy,bbxxyy问:有以下函数intaaa(char*s){char*t=s;while(*t++);t--;return(t-s);}以下关于aaa函数的功能的叙述正确的是().答:求字符串s的长度问:有以下语句,则对a数组元素的引用不正确的是()(0≤i≤9)inta[10]={0,1,2,3,4,5,6,7,8,9},*p=a;答:*(*(a+i))问:有以下函数intfun(char*s){char*t=s;while(*t)t++;re
下面程序的运行结果是 #include<stdio.h> main() {int a=28,b; char s[10],*p; p=s; do{b=a%16; if(b<10) *p=b+48; else*p=b+55; p++;a=a/5;}while(a>0); *p='\0';puts(s);}
A.10
B.C2
C.C51
D.\0
有以下程序: #include <stdio.h>void funl (char * p){ char * q; q=p; while( *q! ='\0') } (*q) ++;q++;}mains( ){ char a[ ] = { "Program" } , * p; p = &a[3]; fun1 (p); printf("% s \n" ,a);}程序执行后的输出结果是( )。
A.Prohsbn
B.Prphsbn
C.Progsbn
D.Program
有以下程序 #include <stdio.h> void fun(char **p) { ++p; printf("%s\n",*p); } main() { char *a[]={"Moming","Afternoon","Evening","Night"}; fun(a); } 程序的运行结果是
A.Afternoon
B.fternoon
C.Morning
D.orning
以下程序的输出结果是______。 #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.1234567
B.7654321
C.1711717
D.7177171
有以下程序: #include <stdio.h> main( ) { char s[ ] ="159" , * p; p=s; printf( "% c", * p + + ); printf("%~", * p++);}程序运行后的输出结果是( )。
A.15
B.16
C.12
D.59