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

题目内容 (请给出正确答案)
单选题
有以下程序:#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

XXX

C

=XX

D

X=


参考答案

参考解析
解析:
主函数首先定义两个结构体变量s1,s2,分别使用字符串拷贝函数strcpy为s1和s2的成员name赋值,再将s2中的成员信息赋值给s1,因此输出为“=”,答案选择A选项。
更多 “单选题有以下程序:#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=” 相关考题
考题 以下程序的输出结果是 【 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);}

考题 设已包含头文件,下列程序段的运行结果是()。char s1[]={"ACDEF"};char s2[]="ABC";strc 设已包含头文件<string.h>,下列程序段的运行结果是( )。 char s1[]={"ACDEF"}; char s2[]="ABC"; strcpy(s1,s2); printf("%d",strlen(s1));A.3B.4C.6D.5

考题 下列程序的运行结果是()。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.不确定的值

考题 有以下程序includestruct STU{char name[10];int num;};void f(char*name, intnum){s 有以下程序 #include <string.h> struct STU { char name[10]; int num; }; void f(char *name, int num) { struct STU s[2]={{"SunDan",20044},{"Penghua",20045}}; num=s[0].num; strcpy(name,s[0].name); } main() { struct STU s[2]={{"YangSan",20041},{"LiSiGuo",20042}},*p; p=s[1]; f(p->name,p->num); printf("%s %d\n",p->name,p->num); } 程序运行后的输出结果是A.SunDan 20042B.SunDan 20044C.LiSiGuo 20042D.YangSan 20041

考题 有以下程序并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

考题 以下程序的输出结果是【】。 include include void main 0 { char s[50]; st 以下程序的输出结果是【 】。include<iostream.h>include <string.h>void main 0 {char s[50];strcpy(s[O], "No" );strcpy(s[1], "123" );strcpy (s[2], "23456" );cout<<s;}

考题 对于下面的程序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

考题 有以下程序: include struct STU (char name[10]; int num; }; 有以下程序: #include <string.h> struct STU (char name[10]; int num; }; void f(char *name, int num) {struct STU s[2]={{"SunDan",20044}.{"Penghua",20045}}; num=s[0].num; strcpy(name,s[0].name); } main() {struct STU s[2]={{"YangSall",20041},{"LiSiGao",20042}},*p;p=s[1]; f(p->name,p->num); printf("%s%d\n",p->name,p->num); } 程序运行后的输出结果是 ______。A.SunDan 20042B.SunDan 20044C.LiSiGuo 20042D.YangSan 20041

考题 下列程序的运行结果是()。 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

考题 以下程序的输出结果是()includemain(){chars1[]="123",s2[]="abc",ss[20]="010";strc 以下程序的输出结果是 ( ) #include<string.h> main() {char s1[]="123",s2[]="abc",ss[20]="010"; strcat(ss+1,strcpy(s2,s1)); printf("%s\n",ss); }A.10123B.0abcC.1123D.01abc

考题 请读程序: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 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

考题 下面程序的运行结果是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.不确定的值

考题 设有如下程序: #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

考题 设已包含头文件,下列程序段的运行结果是()。 char s1[]={"ACDEF"}; char s2[]="ABC"; s 设已包含头文件<string.h>,下列程序段的运行结果是( )。char s1[]={"ACDEF"};char s2[]="ABC";strcpy(s1,s2) ;printf("%d",strlen(s1) );A.3B.4C.6D.5

考题 有以下程序: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

考题 有以下程序:void swap (char *x,char *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,abcB.abc,123C.1bc,a23D.321,cba

考题 以下程序的输出结果是( )。 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 typedef struct{ char name[10]; char sex; int age;}STU;void fun(STU t){ strcpy(t.name,Tong); t.age++;}main(){ STU s[2] = {Hua, 'm', 18, Qin, 'f', 19}; fun(s[1]); printf(%s,%d,%s,%d, s[0].name, s[0].age, s[1].name, s[1].age);}程序运行后的输出结果是(  )。A Hua,19,Tong,19B Hua,18,Tong,20C Tong,19,Qin,19D Hua,19,Tong,19

考题 单选题有如下程序:#include #include struct S{ char name[10];};void change(struct S *data,int value){ strcpy(data-name, ****); value=13;}main(){ struct S input; int num = 4; strcpy(input.name, THIS); change(input,num); printf(%s,%d,input.name,num);}程序运行后的输出结果是(  )。A ****,4B ****,13C THIS,4D THIS,13

考题 单选题有以下程序#include #include struct S{ char name[10];};void change(struct S *data, int value){ strcpy(data-name, #); value = 6;}main(){ struct S input;  int num = 3; strcpy(input.name, OK); change(input, num); printf(%s,%d, input.name, num);}程序运行后的输出结果是(  )。A OK,6B #,6C OK,3D #,3

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

考题 单选题有以下程序 #include voidswap(char*x,char*y) {  chart;  t=*x;  *x=*y;  *y=t; } main() {  char*s1,*s2;  chara[]=abc;  charb[]=123;  s1=a;  s2=b;  swap(s1,s2);  printf(%s,%s,s1,s2); } 程序执行后的输出结果是(  )。A 1bc,a23B abc,123C 123,abcD 321,cba