网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
有以下程序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 20042
B.SunDan 20044
C.LiSiGuo 20042
D.YangSan 20041
参考答案
更多 “ 有以下程序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 ” 相关考题
考题
有以下程序:includeincludeincludevoid f(char*s,char*t){char k;k=*s; *
有以下程序: #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.abcdefgB.gfedcbaC.gbcdefaD.abedcfg
考题
有以下等程序include void f(char *s, char *t){ chark; k=*s; *s=*t; *t=k; s++;t-
有以下等程序#include <string. h>void f(char *s, char *t){ char k; k=*s; *s=*t; *t=k; s++; t--; if(*s) f(s, t);}main (){ char stt[10] ="abcdefg", *p; p=str+strlen (str)/2+1; f (p,p-2); print f ( "%s\n", str);}A.abcdefgB.gfedcbaC.gbcdefaD.abedcfg
考题
有以下程序:includeincludeusingnameSpacestd;classperson{ intage; Char*nam
有以下程序:include <iostream>include <string>using nameSpace std;class person{int age;Char * name;public:person ( int i, Char * str ){int j;j = strlen( str ) + 1;name = new char[ j ];strcpy( name, str );age = i;}~person(){delete name;cout<<"D";}void display(){cout<<name<<":"<<age;}};int main(){person demo( 30,"Smith" );demo.display();return 0;}则该程序的输出结果为:【 】。
考题
有以下程序: include void f(char *s,char *t) {char k; k=*s; +s=*t;
有以下程序: #include<string.h> 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.abcdefgB.gfedcbaC.gbcdefaD.abedcfg
考题
有以下程序: 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
考题
有以下程序段char.name[20];int num;scanf(“name=%s num=%d”,name,&num);当执行上述程序段,并从键盘输入:name=Lili num=1001回车后,name的值为A.LillB.name=LiliC.Lili.num=D.name=Lili num—1001
考题
有以下程序: #include 〈iostream〉 #include 〈string〉 using namespace std; class visited { private: int number; char *name; public: static int glob; void set mes(char *a); }; void visited::set mes(char *a) { name=new char[strlen(A) +1]; strcpy(name,A) ; number=++glob; } int visited::glob-O; int main() { visited person[10]; int i; char str[8]; for(i=0;i5;i++) { cinstr; person[i] .set mes(str); } coutA.5B.4C.3D.2
考题
有以下程序: include include void f(char * s,char*t){char k; k=*s;*s=*
有以下程序: #include <stdio.h>#include <string.h>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] :"abedefg", * p; p = str + strlen(str)/2+1; f(p,p -2); printf( "% s \n" ,str);程序运行后的输出结果是( )。A.abcdefgB.gfedcbaC.gbcdefaD.abedcfg
考题
有以下程序:includeinclude struct STU {char name[10];int hum;};void f(
有以下程序:#include <stdio.h>#include <strine.h> struct STU { char name[10]; int hum;};void f(char * name,iht num){ struct STU s[2] = {{ "SunDan" ,20044} , {" Penghua" ,20045}}; num= s[0]. nnm; strepy(name,s[0], name);}main( ){ struct STU s[2] = {{"YangSan" ,20041 }, { "LiSiGao" ,20042}}, * P; p = s[1]; f(p->name,p->hum); printf("% s %d \n" ,p-> name,p->num);}程序运行后的输出结果是( )。A.SunDan 20042B.SunDan 20044C.LiSiGuo 20042D.YangSan 20041
热门标签
最新试卷