摘要: 1)完成下列程序,该程序计算 10 名学生的平均成绩#include #include struct student { int num; char name[20]; int score;}; struct student stud[10];int main(void){ int i , sum = 0 ; for(i = 0; i struct { int hour, minute, second;} time;int main(void){ scanf("%d: %d: %d", &time.hour, &time.minute, &time. 阅读全文
posted @ 2013-11-21 08:45 部落波萝 阅读(663) 评论(0) 推荐(0) 编辑
摘要: 1) 下面定义结构变量的语句中错误的是 _D__,为什么?A.struct student{ int num; char name[20]; } s;B.struct { int num; char name[20]; } stu;C.struct student{ int num; char name[20]; }; struct student s;D.struct student{ int num; char name[20]; }; struct stu s;2)struct {int x, y; } s[2] = { { 1, 3 }, { 2, 7 } };则语句:printf(“ 阅读全文
posted @ 2013-11-21 08:39 部落波萝 阅读(587) 评论(0) 推荐(0) 编辑
摘要: 一、预习检查:自学教材第九章、阅读博客[结构体简介],并回答以下问题:什么是结构?什么情况下使用结构管理数据?1.结构是c语言中的一种新的结构类型,它能够把有内在联系的不同类型的数据汇聚成一个整体使他们相互关联,同时,结构也是一个变量的集合,可以按照对基本类型的操作方法单独使用其成员变量。 2.各项数据类型不同但之间有内在联系的变量什么是结构定义和结构变量?struct 结构名{类型名 结构成员名1;类型名 结构成员名2;…类型名 结构成员名n;};结构变量:结构类型的变量,通过结构成员操作符.对其成员变量引用,与普通变量作为函数参数相似,实参变量将其结构值传递给对应的形参变量 什么是结... 阅读全文
posted @ 2013-11-21 08:27 部落波萝 阅读(227) 评论(0) 推荐(0) 编辑