笔果题库
计算机二级C语言程序设计
VIP题库
搜题找答案,就上笔果题库
以下对结构体类型变量的定义中,不正确的是______。①typedef struct aa{ int n; float m;}AA;AA td1;②#define AA struct aaAA{ int n; float m; }td1;③struct{ int n; float m;}aa;struct aa td1;④struct{ int n; float m;}td1;
搜题找答案,就上笔果题库
有如下定义struct st{ char name[12]; int age; char sex; } std[10],*p=std;以下语句错误的是______。
搜题找答案,就上笔果题库
有以下程序#include #include typedef struct {char name[10];char sex;int age;} STU;void fun(STU *t){ strcpy((*t).name,"Tong");(*t).age++;}main(){ STU s[2]={"Hua",''m'',18,"Qin",''f'',19};fun(s+1);printf("%s,%d,%s,%d\n",s[0].name,s[0].age,s[1].name ,s[1].age );}程序运行后的输出结果是______。
搜题找答案,就上笔果题库
有以下说明和定义语句struct student{ int age; char num[8];};struct student stu[3]={{20,"200401"},{21,"200402"},{19,"200403"}};struct student *p=stu;以下选项中引用结构体变量成员的表达式错误的是______。
搜题找答案,就上笔果题库
有以下程序#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
搜题找答案,就上笔果题库
若有以下说明和定义:typedef int *INTEGER;INTEGER p,*q;以下叙述正确的是______。
搜题找答案,就上笔果题库
有以下程序#include 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;ix);p=p->y;}}程序的运行结果是______。
搜题找答案,就上笔果题库
有以下程序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);}程序运行后的输出结果是______。
搜题找答案,就上笔果题库
有以下程序struct STU{char num[10]; float score[3];}main(){struct STU s[3]={{"20021",90,95,85},{"20022",95,80,75},{"20023",100,95,90}},*p=s;int i; float sum=0;for(i=0;iscore[i];printf("%6.2f\n",sum);}程序运行后的输出结果是______。
搜题找答案,就上笔果题库
有以下程序#include #include typedef struct stu {char name[10];char gender;int score;} STU;void f(STU c){ strcpy(c.name, "Qian");c.gender = ''f'';c.score = 350;}main(){ STU a={"Zhao", ''m'', 290}, b;b=a;f(b);printf("%s,%c,%d,", a.name, a.gender, a.score);printf("%s,%c,%d\n", b.name, b.gender, b.score);}程序的运行结果是______。