更多"若有以下程序 #include<stdio.h> typedef "的相关试题:
[填空题]有以下程序
#include<stdio.h>
typedef struct
int num;double s;
REC;
void funl(REC *x)
x->num=23;x->s=88.5;
void main( )
REC a=16,90.0;
fun1(&a);
printf("%d/n",a.num);
程序运行后的输出结果是______。
[填空题]有以下程序
#include<stdio.h>
typedef struct
{
int num;double s;
}REC;
void funl(REC *x)
{
x->num=23;x->s=88.5;
}
void main( )
{
REC a={16,90.0};
fun1(&a);
printf("%d/n",a.num);
}
程序运行后的输出结果是______。
[填空题]有以下程序:
#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<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
struct STU
{ int num;
float TotalScore;
};
void f(struct STU p)
{struct STU s[2]={{20044,550},{20045,537}};
p.num=s[1].num; p.TotalScore=s[1].TotalScore;
}
main( )
{ struct STU s[2]= {{20041,703},{20042,580}};
f(s[0]);
printf("%d %3.0f/n",s[0].num,s[0].TotalScore);
}
程序运行后的输出结果是______。
A. 20045 537
B. 20044 550
C. 20042 580
D. 20041 703
[单项选择]有以下程序:
#include
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},{"LiSiGao",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
[单项选择]有以下程序:
#include <string.h>
struct STU
{int num;
float TotalScore;
};
void f(struct STU p)
{struct STU s[2]={{20044,550},{20045,537}};
p.num=s[1].num;p.TotalScore=s[1].TotalScore;
}
main( )
{struct STU s[2]={{20041,703},{20042,580}};
f(s[0]);
printf("%d%3.0t/n",s[0].num,s[0].TotalScore);
}
程序运行后的输出结果是【 】。
A. 20045 537
B. 20044 550
C. 20042 580
D. 20041 703