更多"以下程序的运行结果是______。 # include <strin"的相关试题:
[填空题]以下程序的运行结果是【 】
#include <string.h>
typedef struct student{
char name[10];
long sno;
float score; }STU;
main( )
{ STU a={“zhangsan”,2001,95},b={“Shangxian”,2002,90},
c={“Anhua”,2003,95},d,*p=&d;
d=a;
if(strcmp(a.name,b.name)>0) d=b;
if(strcmp(c.name,d.name)>0) d=c;
printf(“%ld%s/n”,d.sno,p->name); }
[单项选择]有以下程序
#include
#include
typedef struct {char name[9]; char sex; int score[2]; } STU;
STU f(STU a)
{ STU b={"Zhao",’m’,85,90};
int i;
strcpy(a.name,b.name);
a.sex=b.sex;
for(i=0;i<2;i++) a.score[i]=b. score[i];
return a;
}
main( )
{ STU c={"Qian",’f’,95,92}, d;
d=f(c);
printf("%s,%c,%d,%d,",d.name, d.sex, d.score[0], d.score[1]);
printf("%s,%c,%d,%d/n",c.name, c.sex, c.score[0], c.score[1]);
}
程序运行后的输出结果是_______。
A. Zhao,m,85,90,Qian,f,95,92
B. Zhao,m,85,90, Zhao,m,85,90
C. Qian,f,95,92, Qian,f,95,92
D. Qian,f,95,92, Zhao,m,85,90
[填空题]
以下程序的运行结果是 【19】
#include <string.h>
typedef struct student{
char name[10];
long sno;
float score; }STU;
main( )
{ STU a={“zhangsan”,2001,95},b={“Shangxian”,2002,90},
c={“Anhua”,2003,95},d,*p=&d;
d=a;
if(strcmp(a.name,b.name)>0) d=b;
if(strcmp(c.name,d.name)>0) d=c;
printf(“%ld%s/n”,d.sno,p->name);
[填空题]以下程序的运行结果是 【12】 。
# include<string.h>
typedef struct student{
char name[10];
long sno);
float score
} STU;
main( )
{ STU a={"zhangsan",2001,95},b={"Shangxian",2002,90}
c={"Anhua",2003,95},d,*p=&d;
d=a;
if(strcmp(a.name,b.name)>0)d=b;
if(strcmp(c.name,d.name)>0)d=c;
printf("%1d%s/n",d.sno,p->name);
}
[填空题]以下程序的运行结果是
【12】 。
# include<string.h>
typedef struct student
char name[10];
long sno);
float score
STU;
main( )
STU a="zhangsan",2001,95,b="Shangxian",2002,90
c="Anhua",2003,95,d,*p=&d;
d=a;
if(strcmp(
- a.name,
- b.name)>0)d=b;
if(strcmp( - c.name,
- d.name)>0)d=c;
printf("%1d%s/n",d.sno,p->name);
[填空题]以下程序的运行结果是 【19】 。
#include<string.h>
typedef struct student{
char name[10];
long sno;
float score;
} STU;
main( )
STU a={"Zhangsan",2001,95},b={"Shangxian",2002,90},
c={"Anhua",2003,95},d,*p=&d;
d=a;
if(strcmp(a.name,b.name)>0) d=b;
if(strcmp(c.name,d.name)>0) d=c;
printf("%1d%s/n",d.sno,p->name);
}
[填空题]以下程序的运行结果是
【19】 。
#include<string.h>
typedef struct student
char name[10];
long sno;
float score;
STU;
main( )
STU a="Zhangsan",2001,95,b="Shangxian",2002,90,
c="Anhua",2003,95,d,*p=&d;
d=a;
if(strcmp(
- a.name,
- b.name)>0) d=b;
if(strcmp( - c.name,
- d.name)>0) d=c;
printf("%1d%s/n",d.sno,p->name);
[填空题]
以下程序运行时输出到屏幕的结果中第一行是()第二行是()
#include
Typedef struct
{int dm; /*产品代码*/
Char *mc; /*产品名称*/
Long je; /*金额*/
}PRO;
Void main( )
{ int I j,k,n=3;
PRO
sell[10]={{101,apple,100},{301,orange,100},{101,apple,200}},xy;
For(i=0;i { k=I;
For(j=i+1;j If(sell[k].dm If(k!=i)
{xy=sell[i];
Sell[i]=sell[k];
Sell[k]=xy;
}
}
For(i=0;i Printf(%15d%10s%5d/n,sell[i].dm_sell[i].mc.sell[i].je);
}
[填空题]以下程序运行后的输出结果是______。
#include<stdio.h>
typedef struct
int num; double s; REC;
void fun1(REC x)x.num=23; x.s=88.5;
main( )
REC a=16, 90.0;
fun1(a);
printf("%d/n", a.num);
[填空题]
以下程序运行时输出结果中第-行是(),第二行是(),第三行是()
#include
typedef struct{int x;int y;}S;
void fun(S pp[],int n)
{int i,j,k;S t;
for(i=0;i { k=i;
for(j=i+1;j if((pp[j].x k=j;
if(k!=i)
{t=pp[i];pp[i]=pp[k];pp[k]=t;}
}
}
void main( )
{S a[5]={{3,2},{3,1},{1,2},{2,4},{2,3}};
int i,n=5;
fun(a,n);
for(i=0;i printf("%d,%d/n",a[i].x,a[i].y);
}
[填空题]以下程序的运行结果是______。
# include <string.h>
typedef struct student
char name[10];
long sno;
float score;
STU;
main( )
STU a="zhangsan",2001,95,b="Shangxian",2002,90,
c="Anhua",2003,95,d,*p-&d;
d=a;
ifstrcmp(a.nalne,b.name)>0) d=b;
if(strcmp(c.name,d.name)>0) d=c;
printf("%ld%s/n",d.sno,p >name;