没有合适的资源?快使用搜索试试~ 我知道了~
c语言程序编写的统计程序经典
需积分: 9 4 下载量 113 浏览量
2011-03-18
09:55:31
上传
评论
收藏 11KB TXT 举报
温馨提示
试读
18页
c语言程序c语言程序编写的统计程序经典很不错的程序用数据建构写的
资源推荐
资源详情
资源评论
#include "stdio.h"
#include "string.h"
#include "malloc.h"
typedef struct people
{
int number;
char name[20];
int year;
int month;
int day;
struct people *next;
}peo;
typedef struct Age
{
char na[20];
int A;
struct Age *next;
}AGE;
peo *create()
{
int num;
peo *head,*p1,*p2;
head=NULL;
while(1)
{
printf("Please enter the people's number(When number is 0 End)!\n");
scanf("%d",&num);
if(num==0)
break;
p1=(peo*)malloc(sizeof(peo));
#include "string.h"
#include "malloc.h"
typedef struct people
{
int number;
char name[20];
int year;
int month;
int day;
struct people *next;
}peo;
typedef struct Age
{
char na[20];
int A;
struct Age *next;
}AGE;
peo *create()
{
int num;
peo *head,*p1,*p2;
head=NULL;
while(1)
{
printf("Please enter the people's number(When number is 0 End)!\n");
scanf("%d",&num);
if(num==0)
break;
p1=(peo*)malloc(sizeof(peo));
p1->number=num;
printf("Please enter the people's name!\n");
scanf("%s",p1->name);
printf("Please enter the people's age of year!\n");
scanf("%d",&p1->year);
printf("Please enter the people's age of month!\n");
scanf("%d",&p1->month);
printf("Please enter the people's age of day!\n");
scanf("%d",&p1->day);
if(head==NULL)
{
head=p1;
p2=p1;
}
else
{
p2->next=p1;
p2=p1;
}
}
p2->next=NULL;
return head;
}
peo *insert(peo *head)
{
peo *p2;
p2=(peo*)malloc(sizeof(peo));
printf("Please enter the people's number!\n");
scanf("%d",&p2->number);
printf("please enter the people's name!\n");
printf("Please enter the people's name!\n");
scanf("%s",p1->name);
printf("Please enter the people's age of year!\n");
scanf("%d",&p1->year);
printf("Please enter the people's age of month!\n");
scanf("%d",&p1->month);
printf("Please enter the people's age of day!\n");
scanf("%d",&p1->day);
if(head==NULL)
{
head=p1;
p2=p1;
}
else
{
p2->next=p1;
p2=p1;
}
}
p2->next=NULL;
return head;
}
peo *insert(peo *head)
{
peo *p2;
p2=(peo*)malloc(sizeof(peo));
printf("Please enter the people's number!\n");
scanf("%d",&p2->number);
printf("please enter the people's name!\n");
剩余17页未读,继续阅读
资源评论
zero7472762
- 粉丝: 0
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功