【结构体】定义结构体的两方式 struct student{}; struct student a={10001,"云中",'M',"北京"}; struct student{ }a={10001,"云中",'M',"北京"};定义结构体数组a换成a[],struct student stu...
分类:
编程语言 时间:
2015-04-18 17:25:08
阅读次数:
155
#include #include #define Null 0char over=0; //结束标志//结构体类型定义 struct MenuItem { char MenuCount; //结构体数组的元素个数 char *DisplayString; //当前LCD...
分类:
其他好文 时间:
2015-04-18 11:26:39
阅读次数:
291
数据结构基础 最简单的部分 顺序链表实际就是个结构体数组 代码如下 比较简单 1 #include "stdio.h" 2 #include "string.h" 3 #define MAXSIZE 100 4 5 6 7 typedef struct 8 { 9 c...
分类:
其他好文 时间:
2015-04-15 18:27:47
阅读次数:
145
//有n个结构体变量,内含学生号, 姓名和三门课成绩。要求输出平均成绩最高学生的信息。
#include
#define N 3
struct Student
{
int num;
char name[20];
float socre[3];
float aver;
};
void input(struct Student stu[])
{
int i;
printf("Çë·Ö±ð...
分类:
编程语言 时间:
2015-04-15 09:44:14
阅读次数:
194
//用结构体数组完成:有5个学生(包括学号,姓名,成绩),要求按照成绩高低输出学生信息
#include
struct Stu
{
int num;
char name[20];
int score;
};
int main()
{
int i,j;
struct Stu student[5]={{317,"han",89},{318,"hu",50},{319,"kang",84},...
分类:
编程语言 时间:
2015-04-13 23:05:40
阅读次数:
357
//用结构体数组指针完成:有三个学生信息,存放在结构体数组中,要求输出全部信息
#include
struct Stu
{
int num;
char name[20];
char sex;
int age;
};
int main()
{ struct Stu student[3]={{317,"han",'m',20},{318,"hun",'w',22},{311,"dan",'w...
分类:
编程语言 时间:
2015-04-13 21:00:30
阅读次数:
895
//用结构体数组实现:有三个候选人,每个选民只能选一个人,编写一个选票程序,最终输出候选人的票数(假设有十个选民)
#include
#include
struct Person //声明结构体
{
char name[20];
int count;
}leader[3]={"li",0,"zhang",0,"sun",0}; //定义结构体数组并初值化
int...
分类:
编程语言 时间:
2015-04-13 09:32:53
阅读次数:
217
using System;using System.Collections;using System.Collections.Generic;using System.Text;namespace 结构体冒泡排序{ class Program { struct student { public st...
分类:
编程语言 时间:
2015-04-10 20:11:20
阅读次数:
122
//【C语言】通讯录(一个文件实现)#include
#include
#define NAME_MAX 20
#define SEX_MAX 5
#define TEL_MAX 11
#define ADDR_MAX 20
#define PERSON_MAX 1000
typedef struct person
{
char name[NAME_MAX];
char sex[SEX_...
分类:
编程语言 时间:
2015-04-09 08:59:58
阅读次数:
197
C语言4道读程序写结果的题都非常简单其中有指针、static类型的局部变量等问题编程题一道有三问(1)从文件中读取下三角的矩阵,链式的存放,每一行是一个链表,每个元素是一个结构体,有一个结构体数组存放行号和指针。(2)计算对角线上元素的和(3)创建主函数,并调用(1)..
分类:
其他好文 时间:
2015-03-31 13:04:51
阅读次数:
255