求网吧管理系统C# 源代码!

 我来答
sillytime
2011-07-12 · 超过18用户采纳过TA的回答
知道答主
回答量:70
采纳率:0%
帮助的人:43.1万
展开全部
my
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
合力亿捷
2023-07-25 广告
要快速搭建在线客服系统,可以考虑以下步骤:1. 确定需求:首先需要确定自己的需求和目标,例如需要什么类型的客服、需要支持多少用户、需要什么样的沟通工具等等。2. 选择合适的平台:选择一个合适的在线客服系统平台,可以选择公有云或私有云部署方式... 点击进入详情页
本回答由合力亿捷提供
rzrvpveqt
2011-07-13 · TA获得超过851个赞
知道小有建树答主
回答量:519
采纳率:0%
帮助的人:358万
展开全部
#include"stdio.h"
#include"string.h"
#include"malloc.h"
#include"conio.h"
#include"stdlib.h"
#define N 3
typedef struct student{
long num;
char name[20];
int score[4];
struct student* next;
}Student;
char menu();
void input(Student*);
void delete(Student*);
Student* search(Student*,long);
void reexamine(Student*);
void display(Student*);
void dispnode(Student*);
void caidan();
char course[4][20]=,,,};
Student* head;
Student* p;
void main()
{
long num;
int i;
clrscr();
printf("\nEnter %d course names:\n",N);
fflush(stdin);
p=(Student*)malloc(sizeof(Student));
if (p==NULL)
{printf("\nMemory allocation error.");
exit(1);
}
else
{
p->num=0;
p->next=NULL;
strcpy(p->name,"head node");
for(i=0;i<N;i++)
p->score[i]=0;
head=p;
caidan();
}
}
char menu()
{
char ch;
int i;
clrscr();
printf("\n\n\t1 --- -Input\n");
printf("\n\t2 --- Display\n");
printf("\n\t3 --- delete\n");
printf("\n\t4 --- Search\n");
printf("\n\t5 --- Reexamine\n");
printf("\n\t6 --- Exit\n");
printf("\n\n\t\t Enter your choice:");
fflush(stdin);
ch=getchar() ;
getchar();
return ch;
}
void input(Student* h)
{
long num;
Student *p,*q,*r;
int i,n=0;
char ch;
clrscr();
printf("\nEnter data for a student:\n");
printf("\nnum:");
scanf("%ld",&num);
while(num<3)
{
p=search(h,num);
if
(p!=NULL)
{
printf("\n%ld num student has been existed.",num);
printf("\nReenter num for a student,please:");
fflush(stdin);
scanf("%ld",&num);
}
else
{
p=(Student*)malloc(sizeof(Student));
if(p==NULL)
{
printf("\nMemory allocation error.");
exit(0);
}
else
{
n++;
p->num=num;
printf("\nName:");
fflush(stdin);
gets(p->name);
printf("\nEnter %d examine scores:",N);
for(i=1;i<=N;i++)
{
printf("\n%s:\t",course[i]);
scanf("%d",&p->score[i]);
}
}
r=h;
q=r->next;
while(q!=NULL && num>q->num)
{
r=q;
q=q->next;
}
r->next=p;
p->next=q;
clrscr();
printf("\nEnter data for a student:\n");
printf("\nnum:");
scanf("%ld",&num);
}
}
h->num=n;
printf("\n There are(is) %d student(s) were(was) inserted.",n);
printf("\n There are(is) total %ld student(s).",h->num);
printf("press any key back to main menu!");
getchar();
caidan();
}
Student* search(Student* h,long num)
{
Student *p,*q;

q=h;
p=h->next;
if (p==NULL)
return NULL;
else
{
while(p!=NULL && p->num!=num)
{
q=p;
p=p->next;
}
if(p!=NULL && p->num==num)
return(q);
else
return NULL;
}
}
void reexamine(Student* h)
{
Student *p;
int pass;
int i=0;
int nopass=0;
clrscr();
if(h->num==0)
printf("\nThere is no student in the list.");
else
{
p=h->next;
while(p!=NULL)
{
pass=1;
for (i=0;i<N;i++)
{
if(p->score[i]<60)
{pass=0;
nopass++;
break;
}
}
if (pass==0)
{
dispnode(p);
printf("\nEnter any key to continue,please:");
getchar();
}
p=p->next;
}
printf("\n\nThere %s total %ld student(s)",h->num,"are:",h->num);
printf("\nincluded %d student%c no-pass.",nopass);
printf("\nNo-pass percentage is%.2f%%.\n",(float)(nopass)/h->num *100);
}
}
void display(Student*h)
{Student*p;
int many;
clrscr();
if (h->num==0)
printf("\nThere is no student in the list.\n");
else
{p=h->next;
while(p!=NULL)
{
dispnode(p);
printf("\nEnter any to continue,please:");
getchar();
p=p->next;
};
}
{

many=h->num>1;
printf("There%s %1dstudent()s",many?"are":"is",h->num);
}
}
void delete(Student *h)
{Student *p,*q;
int num;
char answer;
clrscr();
printf("\nEnter num of the student being deleted:");
scanf("%ld",&num);
q=search(h,num);
if(q!=NULL)
{
p=q->next;
dispnode(p);
printf("\nDelete the student,are you sure? (Y/N):");
fflush(stdin);
answer=getchar();
answer=tolower(answer);
if (answer=='y')
{
q->next=p->next;
free(p);
h->num--;
}
else
{
printf("\n You change your idea,bye_bye.");
}
}
else
{
printf("\nThe student to be delete is not found.");
}
caidan();
}
void dispnode(Student* h)
{
printf("number name score[1] score[2] score[3]\n");
printf("%ld %s %d %d %d\n",h->num,h->name,h->score[1],h->score[2],h->score[3]);
}
void caidan()
{
int num;
char ch;
do{
ch=menu();
switch(ch)
{case '1':input(head);
break;
case '2':display(head);
caidan();
break;
case '3':delete(head);
break;
case '4':clrscr();printf("\nEnter the number of student:");
scanf("%d",&num);
p=search(head,num);
if (p==NULL)
printf("\n%ld num student is not found.",num);
else
dispnode(p->next);
printf("\nEnter any key to continue,please:");
getchar();
getchar();
caidan();
break;
case '5':reexamine(head);
printf("\nEnter any key to continue,please:");
getchar();
caidan();
break;
case '6':printf("\nExit the program now,bye_bye!");
exit(0);
break;
default:printf("\nYou should press <1> --<6>");
if(ch=='\n' || ch=='\t' ||ch=='')
printf("\nch is thite character.\n");
else
printf("\nch=%c\n",&ch);
break;
}
}while(ch=='6');
}

本回答被网友采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式