会员管理系统c语言(求一个简单的C语言超市收银系统)

本文目录
- 求一个简单的C语言超市收银系统
- 求简单的C语言编程,银行账户管理系统
- 图书馆管理系统 数据结构课程设计 c语言
- 用c语言编写:商店开业办理会员,由于人们不喜欢4,喜欢8, 会员为五位数,请输出所有符合条件的会员号.
- 求一个用C语言编写的“QQ会员信息管理系统”
- 用c语言写一个书店管理系统,包括图书信息 会员信息 销售信息三个系统
- 使用C语言编写QQ会员程序
求一个简单的C语言超市收银系统
这里没有商品信息,需要自己编码添加。
#include 《stdio.h》
#include 《string.h》
typedef struct ln //会员信息
{
char id;//会员账号
char key;//会员密码
int sum;//会员积分
struct ln *next;
} member;
struct lm//商品信息
{
int id;//商品编号
char name;//商品名称
int stock;//商品库存
} goods;
member *registe(member *t);//注册;
void buy();
int main()
{
member *head=(member *)malloc(sizeof(member));
strcpy(head-》id, "0"), strcpy(head-》key, "0");//超市管理员
head-》next=NULL;
int i, a, n, boo=0;
while(1)
{
printf(" 注册会员请按1:\n");
printf(" 会员直接登录请按2:\n");
printf(" 退出请按0:\n");
scanf("%d", &a);
if(a==0) break;
if(a==1) head=registe(head);
else if(a==2) boo=login(head);
if(boo) break;
}
if(a && boo==1)
{
printf(" 尊贵的会员,您登录成功!\n");
buy();
}
printf(" 已经安全退出\n");
}
member *registe(member *t)//注册
{
printf(" 现在开始会员注册\n\n");
char id;
member *p, *q, *r;
p=t;
while(p-》next) p=p-》next;//寻找链表中最后一个结点
while(1)
{
printf(" 请输入您注册的账号,密码:\n");
scanf("%s %s", id, key);
q=t;
while(q)//判断该账号是否已经被注册
{
if(strcmp(q-》id, id)==0) break;
else q=q-》next;
}
求简单的C语言编程,银行账户管理系统
简单的管理系统代码(按照你的要求:输入输出加查找)
优化如下:
#include《stdio.h》
#include《string.h》
struct bank{
char name;
char num;
double money;
};
int input(struct bank gusts,int n);
void output(struct bank gusts,int n);
void find(struct bank gusts,int n);
int main()
{
struct bank gusts;
int n,choose;
printf("请输入要录入数据条数:");
scanf("%d",&n);
input(gusts,n);
printf("按照提示选择相应的操作!\n");
while(1)
{
printf("1:查找 2输出 0结束\n");
scanf("%d",&choose);
if(choose==0)
break;
switch(choose){
case 1:find(gusts,n);break;
case 2:output(gusts,n);break;
default:printf("无此操作!\n");break;
}
}
return 0;
}
int input(struct bank gusts,int n)
{
int i;
if(n》100)
{
printf("数据过多!\n");
return 0;
}
printf("按以下格式输入%d条数据!\n",n);//加了一条提示
printf("姓名 账号 金额 \n");
for(i=0;i《n;i++)
{
scanf("%s %s %lf",gusts.money);//账号不要带空格
}
printf("成功录入%d条账户数据!\n",n);
return 0;
}
void output(struct bank gusts,int n)
{
int i;
printf("姓名 账号 金额 \n");
for(i=0;i《n;i++)
{
printf("%d:%s %s %0.3lf\n",i+1,gusts.money);
}
printf("成功输出所有账户数据!\n");
}
void find(struct bank gusts,int n)
{
int i,choose;
int count;
char name;
printf("请输入查找类型对应的数字编号:1姓名查找 2账户查找 3编号查找 4结束查找:\n");
while(1){
scanf("%d",&choose);
if(choose==4)
break;
else if(choose《1||choose》3)
{
printf("无此种查找!请重新选择!\n");
continue;
}
count=0;
switch(choose){
case 1:
printf("请输入查找的客户姓名:");
scanf("%s",name);
printf("查询结果如下:\n姓名 账户 编号\n");
for(i=0;i《n;i++)
{
if(strcmp(gusts.name,name)==0)
{
printf("%d:%s %s %0.3lf\n",i+1,gusts.money);
count++;
}
}
printf("共查询到%d条结果!\n",count);//加入结果统计
break;
case 2:
printf("请输入查找的客户账户:");
scanf("%s",num);
printf("查询结果如下:\n姓名 账户 编号\n");
for(i=0;i《n;i++)
{
if(strcmp(gusts.num,num)==0)
{
count++;
printf("%d:%s %s %0.3lf\n",i+1,gusts.money);
}
}
printf("共查询到%d条结果!\n",count);//加入结果统计
break;
case 3:
printf("请输入查找的客户编号:");
scanf("%d",&i);
printf("查询结果如下:\n姓名 账户 编号\n");
printf("%d:%s %s %0.3lf\n",i+1,gusts.money);
break;
}
}
}
运行截图:
图书馆管理系统 数据结构课程设计 c语言
#include《stdio.h》
#include《math.h》
#include《string.h》
#include《stdlib.h》
struct books_list
{
char author; /*作者名*/
char bookname; /*书名*/
char publisher; /*出版单位*/
char pbtime; /*出版时间*/
char loginnum; /*登陆号*/
float price; /*价格*/
char classfy; /*分类号*/
struct books_list * next; /*链表的指针域*/
};
struct books_list * Create_Books_Doc(); /*新建链表*/
void InsertDoc(struct books_list * head); /*插入*/
void DeleteDoc(struct books_list * head , int num);/*删除*/
void Print_Book_Doc(struct books_list * head);/*浏览*/
void search_book(struct books_list * head); /*查询*/
void info_change(struct books_list * head);/*修改*/
void save(struct books_list * head);/*保存数据至文件*/
/*新建链表头节点*/
struct books_list * Create_Books_Doc()
{
struct books_list * head;
head=(struct books_list *)malloc(sizeof(struct books_list)); /*分配头节点空间*/
head-》next=NULL; /*头节点指针域初始化,定为空*/
return head;
}
/*保存数据至文件*/
void save(struct books_list * head)
{
struct books_list *p;
FILE *fp;
p=head;
fp=fopen("data.txt","w+"); /*以写方式新建并打开 data.txt文件*/
fprintf(fp,"┏━━━┳━━━━━┳━━━━━┳━━━━━┳━━━━━━┳━━━┳━━━━┓\n"); /*向文件输出表格*/
fprintf(fp,"┃登录号┃ 书 名 ┃ 作 者┃ 出版单位 ┃ 出版时间 ┃分类号┃ 价格 ┃\n");
fprintf(fp,"┣━━━╋━━━━━╋━━━━━╋━━━━━╋━━━━━━╋━━━╋━━━━┫\n");
/*指针从头节点开始移动,遍历至尾结点,依次输出图书信息*/
while(p-》next!= NULL)
{
p=p-》next;
fprintf(fp,"┃%-6.6s┃%-10.10s┃%-10.10s┃%-10.10s┃%-12.12s┃%-6.6s┃%.2f ┃\n",p-》loginnum,p-》bookname,p-》author,p-》publisher,p-》pbtime,p-》classfy,p-》price);
}
fprintf(fp,"┗━━━┻━━━━━┻━━━━━┻━━━━━┻━━━━━━┻━━━┻━━━━┛\n");
fclose(fp);
printf(" 已将图书数据保存到 data.txt 文件\n");
}
/*插入*/
void InsertDoc(struct books_list *head)
{
/*定义结构体指针变量 s指向开辟的新结点首地址 p为中间变量*/
struct books_list *s, *p;
char flag=’Y’; /*定义flag,方便用户选择重复输入*/
p=head;
/*遍历到尾结点,p指向尾结点*/
while(p-》next!= NULL)
{
p=p-》next;
}
/*开辟新空间,存入数据,添加进链表*/
while(flag==’Y’||flag==’y’)
{
s=(struct books_list *)malloc(sizeof(struct books_list));
printf("\n 请输入图书登陆号:");
fflush(stdin);
scanf("%s",s-》loginnum);
printf("\n 请输入图书书名:");
fflush(stdin);
scanf("%s",s-》bookname);
printf("\n 请输入图书作者名:");
fflush(stdin);
scanf("%s",s-》author);
printf("\n 请输入图书出版社:");
fflush(stdin);
scanf("%s",s-》publisher);
printf("\n 请输入图书出版时间:");
fflush(stdin);
scanf("%s",s-》pbtime);
printf("\n 请输入图书分类号:");
fflush(stdin);
scanf("%s",s-》classfy);
printf("\n 请输入图书价格:");
fflush(stdin);
scanf("%f",&s-》price);
printf("\n");
p-》next=s; /*将新增加的节点添加进链表*/
p=s; /*p指向尾节点,向后移*/
s-》next=NULL;
printf(" ━━━━ 添加成功!━━━━");
printf("\n 继续添加?(Y/N):");
fflush(stdin);
scanf("%c",&flag);
printf("\n");
if(flag==’N’||flag==’n’)
{break;}
else if(flag==’Y’||flag==’y’)
{continue;}
}
save(head); /*保存数据至文件*/
return;
}
/*查询操作*/
void search_book(struct books_list *head)
{
struct books_list * p;
char temp;
p=head;
if(head==NULL || head-》next==NULL) /*判断数据库是否为空*/
{
printf(" ━━━━ 图书库为空!━━━━\n");
}
else
{
printf("请输入您要查找的书名: ");
fflush(stdin);
scanf("%s",temp);
/*指针从头节点开始移动,遍历至尾结点,查找书目信息*/
while(p-》next!= NULL)
{
p=p-》next;
if(strcmp(p-》bookname,temp)==0)
{
printf("\n图书已找到!\n");
printf("\n");
printf("登录号: %s\t\n",p-》loginnum);
printf("书名: %s\t\n",p-》bookname);
printf("作者名: %s\t\n",p-》author);
printf("出版单位: %s\t\n",p-》publisher);
printf("出版时间: %s\t\n",p-》pbtime);
printf("分类号: %s\t\n",p-》classfy);
printf("价格: %.2f\t\n",p-》price);
}
if(p-》next==NULL)
{
printf("\n查询完毕!\n");
}
}
}
return;
}
/*浏览操作*/
void Print_Book_Doc(struct books_list * head)
{
struct books_list * p;
if(head==NULL || head-》next==NULL) /*判断数据库是否为空*/
{
printf("\n ━━━━ 没有图书记录! ━━━━\n\n");
return;
}
p=head;
printf("┏━━━┳━━━━━┳━━━━━┳━━━━━┳━━━━━━┳━━━┳━━━━┓\n");
printf("┃登录号┃ 书 名 ┃ 作 者┃ 出版单位 ┃ 出版时间 ┃分类号┃ 价格 ┃\n");
printf("┣━━━╋━━━━━╋━━━━━╋━━━━━╋━━━━━━╋━━━╋━━━━┫\n");
/*指针从头节点开始移动,遍历至尾结点,依次输出图书信息*/
while(p-》next!= NULL)
{
p=p-》next;
printf("┃%-6.6s┃%-10.10s┃%-10.10s┃%-10.10s┃%-12.12s┃%-6.6s┃%.2f ┃\n",p-》loginnum,p-》bookname,p-》author,p-》publisher,p-》pbtime,p-》classfy,p-》price); /*循环输出表格*/
}
printf("┗━━━┻━━━━━┻━━━━━┻━━━━━┻━━━━━━┻━━━┻━━━━┛\n");
printf("\n");
}
/*修改操作*/
void info_change(struct books_list * head)
{
struct books_list * p;
int panduan=0; /*此变量用于判断是否找到书目*/
char temp;
p=head;
printf("请输入要修改的书名:");
scanf("%s",temp);
while(p-》next!= NULL)
{
p=p-》next;
if(strcmp(p-》bookname,temp)==0)
{
printf("\n 请输入图书登陆卡号:");
fflush(stdin);
scanf("%s",p-》loginnum);
printf("\n 请输入图书书名:");
fflush(stdin);
scanf("%s",p-》bookname);
printf("\n 请输入图书作者名:");
fflush(stdin);
scanf("%s",p-》author);
printf("\n 请输入图书出版社:");
fflush(stdin);
scanf("%s",p-》publisher);
printf("\n 请输入图书出版时间:");
fflush(stdin);
scanf("%s",p-》pbtime);
printf("\n 请输入图书分类号:");
fflush(stdin);
scanf("%s",p-》classfy);
printf("\n 请输入图书价格:");
fflush(stdin);
scanf("%f",&p-》price);
printf("\n");
panduan=1;
}
}
if(panduan==0)
{
printf("\n ━━━━ 没有图书记录! ━━━━\n\n");
}
return;
}
/*删除操作*/
void DeleteDoc(struct books_list * head)
{
struct books_list *s,*p; /*s为中间变量,p为遍历时使用的指针*/
char temp;
int panduan; /*此变量用于判断是否找到了书目*/
panduan=0;
p=s=head;
printf(" :");
scanf("%s",temp);
/*遍历到尾结点*/
while(p!= NULL)
{
if(strcmp(p-》bookname,temp)==0)
{
panduan++;
break;
}
p=p-》next;
}
if(panduan==1)
{
for(;s-》next!=p;) /*找到所需删除卡号结点的上一个结点*/
{
s=s-》next;
}
s-》next=p-》next; /*将后一节点地址赋值给前一节点的指针域*/
free(p);
printf("\n ━━━━ 删除成功! ━━━━\n");
}
else /*未找到相应书目*/
{
printf(" 您输入的书目不存在,请确认后输入!\n");
}
return;
}
int main(void)
{
struct books_list * head;
char choice;
head=NULL;
for(;;) /*实现反复输入选择*/
{
printf(" ┏━┓━━━━━━━━━━━━━━━━━━━┏━┓\n");
printf(" ┃ ┃ socat 图书管理系统 ┃ ┃\n");
printf(" ┃ ┗━━━━━━━━━━━━━━━━━━━┛ ┃\n");
printf(" ┃ ●图书信息录入 ┃\n");
printf(" ┃ ┃\n");
printf(" ┃ ●图书信息浏览 ┃\n");
printf(" ┃ ┃\n");
printf(" ┃ ●图书信息查询 ┃\n");
printf(" ┃ ┃\n");
printf(" ┃ ●图书信息修改 ┃\n");
printf(" ┃ ┃\n");
printf(" ┃ ●图书信息删除 ┃\n");
printf(" ┃ ┃\n");
printf(" ┃ ●退出系统 ┃\n");
printf(" ┗━━━━━━━━━━━━━━━━━━━━━━━┛\n");
printf(" 请选择:");
fflush(stdin);
scanf("%c",&choice);
if(choice==’1’)
{
if(head==NULL)
{
head=Create_Books_Doc();
}
InsertDoc(head);
}
else if(choice==’2’)
{
Print_Book_Doc(head);
}
else if(choice==’3’)
{
search_book(head);
}
else if(choice==’4’)
{
info_change(head);
}
else if(choice==’5’)
{
DeleteDoc(head);
}
else if(choice==’6’)
{
printf("\n");
printf(" ━━━━━━━━ 感谢使用图书管理系统 ━━━━━━━━\n");
break;
}
else
{
printf(" ━━━━ 输入错误,请重新输入!━━━━");
break;
}
}
return 0;
}
用c语言编写:商店开业办理会员,由于人们不喜欢4,喜欢8, 会员为五位数,请输出所有符合条件的会员号.
#include《stdio.h》
void main() { int i,j,x,b;
for ( i=0;i《100000;i++ ) {
x=i; b=0;
for ( j=0;j《5;j++,x/=10 )
if ( x%10==4 ) { b=0; break; }
else if ( x%10==8 ) b=1;
if ( b ) printf("%d ",i);
}
printf("\n");
}
求一个用C语言编写的“QQ会员信息管理系统”
我想了好久也还是没写出来,这是刚才复制别人的,我试了,真的不错
#include《stdio.h》
#include《string.h》
#include《conio.h》
#include《stdlib.h》
struct persion
{
char name;
char tep;
}student;
int main()
{
int chose;
struct persion *imf_p=&student
void input(struct persion *p);
void output(struct persion *p);
void change(struct persion *p);
void del(struct persion *p);
void add(struct persion *p);
void end();
printf("\t\t\t\t\t通讯录\n\n");
do
{
printf("\n请正确选择操作:\n");
printf("\n1.全部重输\n2.查看\n3.修改\n4.删除\n5.添加\n6.退出\n\n请选择:");
scanf("%d",&chose);
switch (chose)
{
case 1:
input(imf_p);
break;
case 2:
output(imf_p);
break;
case 3:
change(imf_p);
break;
case 4:
del(imf_p);
break;
case 5:
add(imf_p);
break;
case 6:
end();
}
}
while (1);
}
void input(struct persion *p) //输入
{
FILE *fp;
fp=fopen("imformation.dat","wb");
printf("请输入名字和电话号码:\n");
printf("\n在姓名处输入《-1》结束!\n\n");
while (1)
{
printf("姓名:");
scanf("%s",p-》name);
if (!strcmp(p-》name,"-1"))break;
printf("电话号码:");
scanf("%s",p-》tep);
fwrite(p,sizeof(struct persion),1,fp);
}
fclose(fp);
printf("输入完成!\n");
system("pause");
system("cls");
}
void output(struct persion *p) //查看
{
FILE*fp;
fp=fopen("imformation.dat","rb");
while (1)
{
fread(p,sizeof(struct persion),1,fp);
if (feof(fp))break;
printf("姓名:%s\n",p-》name);
printf("电话:%s\n",p-》tep);
}
fclose(fp);
system("pause");
system("cls");
}
void change(struct persion *p) //修改
{
int i=0;
char name_change;
FILE*fp1,*fp2;
printf("请输入要修改的人名:");
scanf("%s",name_change);
fp1=fopen("imformation.dat","rb+");
fp2=fopen("temp","wb+");
while (feof(fp1)==0)
{
fread(p,sizeof(struct persion),1,fp1);
if (!strcmp(p-》name,name_change))
{
if (feof(fp1))break;
i=1;
printf("请输入新的号码:");
scanf("%s",tep_change);
strcpy(p-》tep,tep_change);
}
if (feof(fp1)==0)
fwrite(p,sizeof(struct persion),1,fp2);
}
fclose(fp2);
fclose(fp1);
remove("imformation.dat");
rename("temp","imformation.dat");
if (i==1)
printf("已成功修改!\n");
if (i==0)
printf("没有搜索到文件!\n");
system("pause");
system("cls");
}
void del(struct persion *p) //删除
{
int i=0;
char name_change;
FILE*fp1,*fp2;
printf("请输入要删除的人名:");
scanf("%s",name_change);
fp1=fopen("imformation.dat","rb+");
fp2=fopen("temp","wb+");
while (!feof(fp1))
{
fread(p,sizeof(struct persion),1,fp1);
if (!strcmp(p-》name,name_change))
{
i=1;
continue;
}
if (!feof(fp1))
fwrite(p,sizeof(struct persion),1,fp2);
}
fclose(fp2);
fclose(fp1);
remove("imformation.dat");
rename("temp","imformation.dat");
if (i==1)
printf("已完成删除操作!\n");
if (i==0)
printf("没有搜索到名字!\n");
system("pause");
system("cls");
}
void add(struct persion *p) //增加
{
FILE *fp1,*fp2;
fp1=fopen("imformation.dat","rb+");
fp2=fopen("temp","wb+");
while (!feof(fp1))
{
fread(p,sizeof(struct persion),1,fp1);
if (!feof(fp1))
fwrite(p,sizeof(struct persion),1,fp2);
}
printf("请输入要增加的名字和电话号码:\n");
printf("\n在姓名处输入《-1》结束!\n\n");
while (1)
{
printf("姓名:");
scanf("%s",p-》name);
if (!strcmp(p-》name,"-1"))break;
printf("电话号码:");
scanf("%s",p-》tep);
fwrite(p,sizeof(struct persion),1,fp2);
}
fclose(fp1);
fclose(fp2);
remove("imformation.dat");
rename("temp","imformation.dat");
printf("输入完成!\n");
system("pause");
system("cls");
}
void end()
{
exit(0);
}
用c语言写一个书店管理系统,包括图书信息 会员信息 销售信息三个系统
#include
#include
#include
#include "graphics.h"
#include "math.h"
#define m 1
struct data
{ int year;
int month;
int day;
};
struct ReaderNode
{
char num;
struct data bro;
struct data back;
};
struct BookNode
{
char title;
char writer;
int currentnum;
int totalnum;
char brief;
struct ReaderNode reader;
};
struct TreeNode
{
int n;
struct TreeNode *prt;
int key;
struct BookNode *rec;
struct TreeNode *link;
};
struct BookNode *InputNode();
struct TreeNode *mbsearch(struct TreeNode *bth,int x,int *k,int *flag);
struct TreeNode *mbinsert(struct TreeNode *bth);
struct TreeNode *mbdel(struct TreeNode *bth);
void OutputNode(struct TreeNode *bth);
void borrow(struct TreeNode *bth);
void payback(struct TreeNode *bth);
char menu(void);
struct TreeNode *mbsearch(struct TreeNode *bth,int x,int *k,int *flag)
{
struct TreeNode *p,*q;
p=bth; *flag=0; q=p;
while( (p!=NULL) && (*flag==0) )
{
*k=1;q=p;
while( (*k q-》n) && ( q-》key 《 x) ) *k=*k+1;
if( q-》key==x) *flag=1;
else if( ( *k==q-》n ) && ( q-》key;p-》prt=q;}
else { p=q-》link; p-》prt=q;*k=*k-1;}
}
return(q);
}
使用C语言编写QQ会员程序
多加点分啊
#include《stdio.h》
#include《string.h》
#include 《stdlib.h》
struct QqVip
{
char name;//名
int age;//年龄
int Qb;//Q币
bool sex;//true为男
int timelim;//期限
};
int option()
{
printf("1.查看会员信息\n");
printf("2.查找指定会员\n");
printf("3.添加会员\n");
printf("0.退出\n");
printf("请选择:");
fflush(stdout);
int temp;
scanf("%d",&temp);
fflush(stdin);
return temp;
}
void look(QqVip* vip,int num)
{
printf("会员数:%d\n",num);
if (num《1)
{
return;
}
printf("姓 名\t年龄\t性别\tQ 币\t会员期限\n");
for(int i=0;i《num;i++)
{
printf("%6s\t%4d\t%4s\t%5d\t%8d\n",vip.timelim);
}
}
void add(QqVip* vip,int *num)
{
if(*num》=100)
{
printf("数量已满,无法加入\n");
return;
}
printf("请输入会员姓名、年龄、性别、Q 币、会员期限(以回车分隔):\n");
fflush(stdout);
scanf("%s",vip.name);
scanf("%d",&vip.age);
char sex;
scanf("%s",sex);
if (strcmp(sex,"男")==0)
{
vip.sex=true;
}
else
{
vip.sex = false;
}
scanf("%d",&vip.Qb);
scanf("%d",&vip.timelim);
fflush(stdin);
(*num)++;
}
void serch(QqVip* vip,int num)
{
if (num《1)
{
printf("无会员\n");
return;
}
char n;
printf("输入要查找会员姓名:");
scanf("%s",n);
fflush(stdin);
for (int i=0;i《num;i++)
{
if (strcmp(vip.name,n)==0)
{
printf("该会员信息为:\n");
printf("%6s\t%4d\t%4s\t%5d\t%8d\n",vip.timelim);
fflush(stdout);
break;
}
}
}
void main()
{
int num=0;
QqVip vip;
int r;
while(r=option())
{
switch(r)
{
case 1:
look(vip,num);
break;
case 2:
serch(vip,num);
break;
case 3:
add(vip,#);
break;
default:
break;
}
}
printf("exit..\n");
system("PAUSE");
}

更多文章:
制作网页时通常需要在同一网页内跳转常常采用制作什么超链接(简述在网页设计中制作超链接的类型)
2026年9月5日 07:00
开发工具按钮是表格部分数据清零(怎么添加一个Excel批量删除多个单元格内容按钮)
2026年9月5日 05:45
石家庄网站优化全包(石家庄公交第三批线网线优化什么时候开始)
2026年9月5日 05:15
一个卖东西的微信小程序,都需要什么条件怎么制作?我想做一个社区团购的小程序,怎么入手呢,大概需要花多少钱
2026年9月5日 05:00





