#include "stdio.h"
struct teach
{char name[20];
int mun;
char sex[2];
int age;
int workage;
char xi[30];
struct teach *next;};
struct teach *head,*end;
void input(nf)
struct teach *nf;
{struct teach *p;
int i;
p=nf;
printf("inter you information\n\7");
printf("name\n") ;
scanf("%s",p->name);
printf("munber\n");
scanf("%d",&p->mun);
printf("sex\n");
scanf("%s",p->sex);
printf("age\n");
scanf("%d",&p->age);
printf("workage\n");
scanf("%d",&p->workage);
printf("suo zhai yuan xi\n ");
scanf("%s",p->xi);
if(head==NULL)
{head=p;p->next=NULL;end=p;}
else
{end->next=p;p->next=NULL;end=p;}
}
fnd(name)
char *name;
{int i;
struct teach *p;
p=head;
if(p==NULL)
printf("nothing\n");
else
while(p!=NULL)
{if(strcmp(name,p->name)==0)
{printf("-------------------");
printf("\n%s\n",p->name);
printf("%d\n",p->mun);
printf("%d\n",p->age);
printf("%d\n",p->workage);
printf("%s\n",p->sex);
printf("%s\n\n",p->xi);
return; }
p=p->next;
printf("not find\n\7");}}
void fn()
{struct teach *p;
p=head;
while(p!=NULL)
{if(p->age>=60)
{printf("\n%s\n",p->name);
printf("%s\n",p->xi);}
printf("----next one------------");
p=p->next;}}
main()
{char name[20];
int a,i;
struct teach *nf;
static char *b[]={"input(1)","find(2)","fn(3)","quit(4)"};
do{
for(i=0;i<4;i++)
printf("%s\n",b[i]);
scanf("%d",&a);
switch(a)
{case 1: nf=(struct teach *)malloc(sizeof(struct teach)); input(nf);break;
case 2: printf("enter name\n\7"); scanf("%s",name); fnd(name);break;
case 3: fn(); break;
case 4: exit(1);;break;
default: printf("error");break;}}while(a!=4);}
没有合适的资源?快使用搜索试试~ 我知道了~
c数据库小程序c数据库小程序c数据库小程序
共3个文件
exe:1个
suju:1个
c:1个
3星 · 超过75%的资源 需积分: 10 35 下载量 174 浏览量
2009-03-23
10:36:58
上传
评论
收藏 9KB ZIP 举报
温馨提示
c语言 数据库 小程序,c数据库小程序c数据库小程序c数据库小程序
资源推荐
资源详情
资源评论
收起资源包目录
c数据库小程序.zip (3个子文件)
SUJU.EXE 14KB
SUJU 0B
SUJU.C 2KB
共 3 条
- 1
资源评论
- lkc19892012-07-03还不错,可以运行
mocushile
- 粉丝: 1
- 资源: 9
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功