更多"#include <stdio.h> struct date "的相关试题:
[填空题]设有说明:
struct DATE int year; int month; int day;;
请写出一条定义语句,该语句定义d为上述结构体类型变量,并同时为其成员year,month、day依次赋初值2006、10、1:______。
[填空题]设有说明
struct DATE int year;int month;int day;;
请写出一条定义语句,该语句定义d为上述结构体类型变量,并同时为其成员year、month、day依次赋初值2006、10、1:______。
[单项选择]有以下程序:
#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 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>
typedef struct abc
{int a,b,c;
};
main( )
{struct abe s[2]={{1,2,3),{4,5,6}};
int t=-s[0].a+s[1].b;
printf("%d/n",t);
}
[填空题]#include<stdio.h>
struct mine{int qa,qb,qc;};
main( )
{struct mine s[2]={{1,2,3},{4,5,6}};
int answer;
answer=s[0].qa%s[1].qb;
printf("%d/n",answer);
}
程序运行结果是:______
[填空题]已有定义如下:
struct node
{ int data;
struct node *next;
} *p;
以下语句调用malloc函数,使指针p指向一个具有struct node类型的动态存储空间。请填空。
p=(struct node *)malloc( 【10】 );
[填空题]已有定义如下:
struct node
{ int data;
struct node *next;
} *p;
以下语句调用malloc函数,使指针p指向一个具有struct node类型的动态存储空间。请填空。 p = (struct node *)malloc(【 】);
[单项选择]有以下程序: struct S{int n;int a[20];}; void f(struct S*P) { int i,j,t; for(i=0;i<P->n-1;i++) for(j=j+1;j<P->n-1;j++) if(p->a[i]>p->a[j]) {t=P->a[i];p->a[i]=P->a[j];p->a[j]=t} } main( ) {int i;struct S s{10,{2,3,1,6,8,7,5,4,10,9}}; f(&s); for(i=0;i<s.n;i++)printf("%d",s.a[i]);} 程序运行后的输出结果是______。
A. 3
B. 4
C. 5
D. 6