笔果题库
计算机二级C语言程序设计
VIP题库
搜题找答案,就上笔果题库
有以下程序#include typedef struct stu {char name[10];char gender;int score;} STU;void f(STU a, STU *b){ a = *b;printf("%s,%c,%d,", a.name, a.gender, a.score);}main(){ STU a = {"Zhao", ''m'', 290}, b = {"Qian", ''f'', 350};f(a,&b);printf("%s,%c,%d\n", a.name, a.gender, a.score);}程序运行后的输出结果是______。
搜题找答案,就上笔果题库
若有以下定义和语句union date{ int i; char c; float f;} x;int y;则以下语句正确的是______。
搜题找答案,就上笔果题库
设有如下定义struct{ int n; char c; } a[2],*p=a;则以下错误引用结构体成员n的是______。
搜题找答案,就上笔果题库
有如下程序#include struct pair{int first, second;};struct pair get_min_max(int* array, int len){int i;struct pair res;res.first = array[0];res.second = array[0];for (i=1; i res.second)res.second = array[i];}return res;}main(){int array[6] = {19, 21, 3, 4};struct pair min_max = get_min_max(array, 6);printf("min=%d,max=%d\n", min_max.first, min_max.second);}程序运行后的输出结果是______。
搜题找答案,就上笔果题库
有以下程序#include struct date{int year,month, day;};struct time{int hour,minute, second;};struct stu{struct date dt;struct time tt;};void main(){struct stu recd[3] = {{{2016, 3, 5},{12, 25, 30}},{{2017, 5, 8}, {8, 45, 55}},{{2015, 6, 8}, {22, 15, 26}}};int i;for(i=1;i=2016)printf("%d-%d",recd[i].dt.month,recd[i].dt.day);elseprintf("%d-%d",recd[i].tt.minute,recd[i].tt.second);printf ("\n");}}程序执行后的输出结果是______。
搜题找答案,就上笔果题库
若有如下定义struct some{char name[20];int age;} a={"lin",18},b;则以下选项中可以正确执行的是______。
搜题找答案,就上笔果题库
有如下程序#include struct person{char name[10];int age;}main(){struct person room[4] = {{"Zhang", 19}, {"Li", 20}, {"Wang", 17}, {"Zhao", 18}};printf("%s:%d\n", (room+2)->name, room->age);}程序运行后的输出结果是______。
搜题找答案,就上笔果题库
有以下程序#include struct link{int data;struct link* next;};main(){ struct link *h,a ,b;h=&a; a.data=10; a.next=&b; b.data=20;┋}程序运行时不能输出10,20的语句是______。
搜题找答案,就上笔果题库
设有以下语句typedef struct S{ int g;char h;} T;则下面叙述中正确的是______。
搜题找答案,就上笔果题库
有以下程序#include typedef struct{char name[10];int age;}ST;main(){ ST stud[10]={ "Adum", 15,"Muty", 16,"Paul", 17,"Johu", 14,};┋}程序运行后不能输出字符u的语句是______。