更多"有以下程序: #include<stdio.h> struct t"的相关试题:
[单项选择]
有以下程序
#include
#include
struct A
{ int a; char b[10]; double c;};
void f(struct A t);
main( )
{ struct A a={1001,"ZhangDa",1098.0};
f(a); printf("%d,%s,%6.1f/n",a.a,a.b,a.c);
}
void f(struct A t)
{ t.a=1002; strcpy(t.b,"ChangRong");t.c=1202.0;}
程序运行后的输出结果是()
A. 1001,zhangDa,1098.0
B. 1002,changRong,1202.0
C. 1001,ehangRong,1098.O
D. 1002,ZhangDa,1202.0
[单项选择]有以下程序:
#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<stdio.h>
struct tt
int x;struct tt *y; *p;
struct tt a[4]=20,a+1,15,a+2,30,a+3,17,a
main( )
int i;
p=a;
for(i=1;i<=2;i++)printf("%d",p->x);p=p->y;
程序的运行结果是______。
A. 20,30,
B. 30,17
C. 15,30
D. 20,15
[填空题]有以下程序:
#include<stdio.h>
typedef struct
int num;double s;)REC;
void funl(REC x)x.num=23;x.s=88.5;
main( )
REC a=16,90.0);
fun1(a);
printf("%d/n",a.num);
程序运行后的输出结果是______。
[单项选择]有以下程序:
#include <stdlib.h>
struct NODE
int num; struct NODE *next; ;
main( )
struct NODE *p,*q,*r;
p=(struct NODE*)malloc(sizeof(struct NODE));
q=(struct NODE*)mallloc(sizeof(struct NODE));
r=(struct NODE*)malloc(sizeof(struct NODE));
p->num=10;q->num=20; r->num=30;
p->next=q;q->next=r;
printf("%d/n",p->num+q->next->num);
程序运行后的输出结果是( )。
A. 10
B. 20
C. 30
D. 40
[单项选择]有以下程序:
#include <stdio.h>
typedef struct { int b, p; }A;
void f(A c)/* 注意:c是结构变量名*/
{ int j;
c.b+=1; c.p+=2;
}
main( )
{ int i;
A a={1, 2};
f(a);
printf("%d, %d/n", a.b, a.P);
}
程序运行后的输出结果是______。
A. 2, 4
B. 1, 2
C. 1, 4
D. 2, 3
[单项选择]有以下程序
#include<stdlib.h>
struct NODE
int num;struct NODE*next;;
main( )
struct NODE*p,*q,*r;
p=(struct NODE*)malloc(sizeof(struct NODE));
q=(struct NODE*)malloc(sizeof(struct NODE));
r=(struct NODE*)malloc(sizeof(struct NODE));
p->num=10;q->num=20;r->num=30;
p->next=q;q->next=r;
printf("%d/n",p->num+q->next->num);
程序运行后的输出结果是
A. 10
B. 20
C. 30
D. 40
[填空题]有以下程序:
#include<stdio.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.0f/n", s[0]. num, s[0]. TotalScore);
程序运行后的输出结果是______。
[单项选择]有以下程序:
#include <string.h>
struct STU
int num;
float TotalScore;;
void f(struct STU p)
struct STU s[2]=126,55,125,90;
p.num=s[1].num; p.TotalScore=s[1].TotalScore;
main( )
struct STU s[2]=123,76,124,80;
fs[0]);
printf("%d %3.0f/n",s[1].num,s[1].TotalScore);
程序运行后输出的结果是( )。
A. 123 76
B. 126 55
C. 124 80
D. 125 90
[单项选择]有以下程序:
#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<stdio.h>
typedef struct
{int num;double s;}REC;
void funl(REC x){x.num=23;x.s=88.5;}
main( )
{ REC a=<16,90.0};
funl (A) ;
printf("%d/n",a.mum);
}
程序运行后的输出结果是______。
[单项选择]有以下程序:
#include <stdio.h>
struct ord
int x,y; dt[2]=11,12,13,14;
main( )
struct ord *p=dt;
printf("%d,",++(p->x));printf("%d/n",++(p->y));
程序运行后的输出结果是
A. 11,12
B. 12,13
C. 13,14
D. 14,11
[单项选择]有以下程序:
#include <stdio.h>
struct st
int x, y; ) data[2]=1, 10, 2, 20;
main( )
struct st *p=data;
printf("%d, ",p->y); printf("%d/n",(++p) ->x);
程序的运行结果是( )。
A. 10, 1
B. 20, 1
C. 10, 2
D. 20, 2
[单项选择]以下程序运行后的输出结果是
#include<stdio.h>
struct st
int x,y; data[2]=1,10,2,20;
main( )
struet st *p=data;
printf("%d,",p->y);printf("%d/n",(++p)->x);
A. 10,1
B. 20,1
C. 10,2
D. 20,2
[单项选择]有以下程序:
#include <stdio.h>
struct ord
int x,y;dt[2]=1,2,3,4;
main( )
struct ord *p=dt;
printf("%d,",++(p->x));printf("%d/n",++(p->y));
程序运行后输出的结果是( )。
A. 1,2
B. 4,1
C. 3,4
D. 2,3
[单项选择]有以下程序:
#include <stdio.h>
struct S
int a,b;data[2]=10,100,20,200;
main( )
struct S p=data[1];
printf("%d/n",++(p.a));
程序运行后输出的结果是( )。
A. 10
B. 11
C. 20
D. 21