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

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

【单选题】下面程序运行结果是()。 #include<stdio.h> #include<string.h> main() {char *s1=”AbDeG”; char *s2=”AbdEg”; s1+=2; s2+=2; printf(“%dn”,strcmp(sl,s2));}

A.正数

B.负数

C.零

D.不确定的值


参考答案和解析
emoclew emoclew
更多 “【单选题】下面程序运行结果是()。 #include<stdio.h> #include<string.h> main() {char *s1=”AbDeG”; char *s2=”AbdEg”; s1+=2; s2+=2; printf(“%dn”,strcmp(sl,s2));}A.正数B.负数C.零D.不确定的值” 相关考题
考题 以下程序的输出结果是 【 18 】 。# include stdlib.hmain( ){ char *s1,*s2,m;s1=s2=(char*)malloc(sizeof(char));*s1=15; *s2=20; m=*s1+*s2;printf("%d\n",m);}

考题 以下程序的输出结果是______# includemain(){char *s1,*s2,m;s1=s2=(char*)malloc(sizeof(char));*s1=15;*s2=20;m=*s1+*s2;printf(“%d\n”,m);}

考题 下面程序的输出结果是( )。#include "string.h"fun(char*w,int n){ char t,*s1,*s2;s1=w; s2=w+n-1;while(s1s2){ t=*s1++;*s1=*s2--;*s2=t;}}main(){ static char p[]="1234567";fun(p,strlen(p));printf("%s",p);}A.7654321 B.1717171 C.7171717 D.1711717

考题 下列程序的运行结果是()。includeincludemain(){ char*s1="ahDuj";char*s2= 下列程序的运行结果是( )。#include<stdio.h>#include<string.h>main(){ char*s1="ahDuj"; char*s2="ABdUG": int t; t=strcmp(s1,s2); printf("%d", t);}A.正数B.负数C.零D.不确定的值

考题 有以下程序并includeincludefun(char * w,int n){char t,*s1,*s2; s1=w;s2= 有以下程序 并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.1234567B.7654321C.1711717D.7177171

考题 对于下面的程序includeincludechar *scmp(char*s1,char*s2){if(strcmp(s1, 对于下面的程序 #include<stdio.h> #include<string.h> char *scmp(char*s1,char*s2) { if(strcmp(s1,s2)<0)return(s1); else return(s2); } main() { int i:char string[20],sb[3][20]; for(i=0;i<3;i++)gets(str[i]); strcpy(string,scmp(str[0],str[1])); strcpy(string,scmp(string,str[21)); printf("%s\n",string); } 若运行时依次输入abcd、abba和abc三个字符串,则输出结果为______。A.abcdB.abbaC.abcD.abca

考题 以下程序中函数scmp的功能是返回形参指针s1和s2所指字符串中较小字符串的首地址#include <stdio.h>#include <string.h>char *scmp(char *s1, char *s2){ if(strcmp(s1,s2)0)return(s1);else return(s2);}main( ){ int i; char string[20], str[3][20];for(i=0;i3;i++) gets(str[i]);strcpy(string,scmp(str[0],str[1])); /*库函数strcpy对字符串进行复制*/strcpy(string,scmp(string,str[2]));printf("%s\n",string);}若运行时依次输入:abcd、abba和abc三个字符串,则输出结果为A.abcdB.abbaC.abcD.abca

考题 下列程序的运行结果是()。 include include main() {char*s1="abDuj"; char 下列程序的运行结果是( )。#include<stdio.h>#include<string.h>main(){ char*s1="abDuj";char*s2="ABdUG";int t;t=strcmp(s1,s2) ;printf("%d",t);}A.正数B.负数C.零D.不确定的值

考题 以下程序的输出结果是______。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

考题 请读程序:includeincludemain(){char *s1="AbCdEf",*s2="aB"; s1++;s2++; 请读程序: #include<stdio.h> #include<string.h> main() { char *s1="AbCdEf",*s2="aB"; s1++;s2++; printf("%d\n",strcmp(s1,s2)); } 上面程序的输出结果是______。A.正数B.负数C.零D.不确定的值

考题 对于下面的程序includeincludechar * scmp(char * s1,char * s2){if(strcm 对于下面的程序 #include<stdio.h> #include<string.h> char * scmp(char * s1,char * s2) { if(strcmp(s1,s2)<0)return(s1); else return(s2); } main() { int i;char string[20],str[3][20]; for(i=0;i<3;i++)gets(str[i]); strcpy(string,scmp(str[0],str[1])); strcpy(string,scmp(string,str[2])); printf("%s\n",string); } 若运行时依次输入abcd、abba和abc三个字符串,则输出结果为 ______。A.abcdB.abbaC.abcD.abca

考题 以下程序的输出结果是______。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

考题 以下程序的输出结果是【】。 include viod main() {char sl[5]= "ABCD", s2=[5];int k 以下程序的输出结果是【 】。include<iostream. h>viod main() {char sl[5]= "ABCD", s2=[5];int k;for(k=0;k<4:k++)s2[k]=(sl[k]- '0' +1) + '0' ;s2[k]= '\0' ;cout<<s2;

考题 下述程序的运行结果是( )。 #included stdio.h #included strin9.h main { char*s1="abDuj"; char*s2="ABdUG"; int t; t=strcmp(s1,s2); printf("%d",t); }A. 正数B.负数C.零D.不确定的值

考题 下面程序的运行结果是()。includeincludemain(){char*s1="abDuj";char*s2=" 下面程序的运行结果是( )。 #include<stdio.h> #include<string.h> main() {char*s1="abDuj"; char*s2="ABdUG"; int t; t=strcmp(s1,s2); printf("%d",t); }A.正数B.负数C.零D.不确定的值

考题 下列程序运行后,输出结果是______。 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

考题 以下程序includemain(){char a1[80],a2[80],*s1=a1,*s2=a2; gets(s1);gets(s2) if(!s 以下程序 #include<string.h> main() { char a1[80],a2[80],*s1=a1,*s2=a2; gets(s1);gets(s2) if(!strcmp(s1,s2))printf("*"); else printf("#"); printf("%d\n",strlen(strcat(s1,s2))); } 如果从键盘上输入: book<回车> book<空格><回车> 则输出结果是( )A.*8B.#9C.#6D.*9

考题 下面程序的运行结果是includeincludemain(){ char*s1="AbDeG";char*s2="Ab 下面程序的运行结果是 #include<stdio.h> #include<string.h> main() { char*s1="AbDeG"; char*s2="AbdEg"; s1+=2;s2+=2; printf("%d\n",strcmp(s1,s2)); }A.正数B.负数C.零D.不确定的值

考题 以下程序的输出结果是_______。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

考题 请读程序:includeincludemain(){char*s1="AbCdEf",*s2="aB";s1++;s2++;pri 请读程序: #include<stdio.h> #include<string.j> main() { char*s1="AbCdEf",*s2="aB"; s1++;s2++; printf("%d\n",strcmp(s1,s2)); }上面程序的输出结果是______。A.正数B.负数C.零D.不确定的值

考题 设有如下程序: #include'string.h" main() { static char s1[20],s2[20]; scanf("%s",s1);scanf("%s",s2); if(strcmp(s1,s2)) printf("@"); else printf("$"); printf("%d\n",strlen(strcat(s1,s2))); } 如果从键盘上输入name1<回车>name2<回车>,则程序运行后的输出结果是( )。A.$9B.@11C.$10D.@10

考题 下面程序的运行结果是 ( ) include include main( ) { char * a=" 下面程序的运行结果是 ( ) # include<stdio.h> # include<string.h> main( ) { char * a="AbcdEf",* b="aBcD" a + +;b + +; printf("%d\n",strcmp(a,b)); }A.0B.负数C.正数D.无确定值

考题 有以下程序:include void swap(char * x,ehar * y){ char t;t= *x; *x: *y; *y=t;main 有以下程序:#include <stdio.h>void swap(char * x,ehar * y){ char t; t= *x; *x: *y; *y=t;main ( ){ char *s1 ="abc", * s2 ="123"; swap(s1 ,s2); printf("%s,%s \n" ,s1 ,s2);}程序执行后的输出结果是( )。A.123,abeB.abe,123C.1bc,a23D.321,cba

考题 下面程序的运行结果是______。 include include fun(char*w,int n) { char 下面程序的运行结果是______。 #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.7654321B.1714171C.1711717D.7177171

考题 以下程序的输出结果是( )。 include main() {char*s1,*s2,m; s1=s2=(char*)malloc(size 以下程序的输出结果是( )。include<stdlib.h>main(){char*s1,*s2,m;s1=s2=(char*)malloc(sizeof(char));*s1=15;*s2=20;m=*s1+*s2:printf("%d\n",m);}

考题 下列程序的运行结果是()。      #include   #include   FUN(char *w,int n)  {   char temp,*s1,*s2; s1=w;  s2=w+n-1;  while(s1temp=*s1++;  *s1=*s2--;  *s2=temp;  }  }      main( )  {   char *p;  p=“1234567”;  FUN(p,strlen(p));  puts(p);  }

考题 填空题下列程序的运行结果是()。      #include   #include   FUN(char *w,int n)  {   char temp,*s1,*s2; s1=w;  s2=w+n-1;  while(s1temp=*s1++;  *s1=*s2--;  *s2=temp;  }  }      main( )  {   char *p;  p=“1234567”;  FUN(p,strlen(p));  puts(p);  }

考题 单选题有以下程序:#include #include struct S{ char name[10];};main(){ struct S s1,s2; strcpy(s1.name,XXX); strcpy(s2.name,=); s1=s2; printf(%s,s1.name);}程序运行后的输出结果是(  )。A =B XXXC =XXD X=