📄 yundonghuiguanlixitong.txt
字号:
#include
#define A 100
int y=0,f=0,j,W,M,N,p[15],q[15];
struct student
{ char shool[20];
char name[20];
char item[20];
char sex;
int position;
int mark;
}stu[A];
struct item
{ char name[20];
char sex;
int mark;
}it[A];
struct shool
{ char name[20];
char item[20];
int mark;
}sho[A];
main()
{
menu();
}
menu()
{ int w1,n;
do
{ puts('tt*****************MENU********************');
puts('nntt 1.The information to writeinn');
puts('tt 2.The race result records to writeinn');
puts('tt 3.Search the informationn');
puts('tt 4.Exitn');
puts('ntt*****************************************');
puts('nnChoice you number:');
scanf('%d',&n);
if(n4){w1=1;getchar();}
else w1=0;
}while(w1==1);
switch(n)
{ case 1:establish();break;
case 2:enter();break;
case 3:search();break;
case 4:exit(0);
}
}
establish()
{ int h,r; extern N,M,W;
y=1;
printf('nThe number of shool attended is:');
scanf('%d',&N);
printf('nThe number of men item is:');
scanf('%d',&M);
printf('nThe number of women item is:');
scanf('%d',&W);
printf('nThere are three form of marked you can choice:');
printf('nnt1).1th--7,2th--5,3th--3,4th--2,5th--1.');
printf('nnt2).1th--5,2th--3,3th--1.');
printf('nnt3).Define by youself.');
loop: printf('nnChoice the number(1--3):');
scanf('%d',&h);
if(h>0&&h
switch(h)
{case 1:j=1;break;
case 2:j=2;break;
case 3:define_mark();
}
else goto loop;
printf('Success!!!nPress any key+Enter to menu..');scanf('%d',&r);
menu();
}
enter()
{ int t,r,i=0;extern j,y;char F,M;
if(y==0)
{ printf('Please establish system first!!nPress any key+Enter to menu.. ');
scanf('%d',&r);
menu();
}
do
{
printf('nPlease enter the student's name:t');scanf('%s',&stu[i].name);
printf('nPlease enter the student's shool:t');scanf('%s',&stu[i].shool);
printf('nPlease enter the student's item:t');scanf('%s',&stu[i].item);
loop_1: printf('nPlease enter the student's sex(W or M):t');scanf('%s',&stu[i].sex);
if(stu[i].sex!='W'&&stu[i].sex!='M')goto loop_1;
printf('nPlease enter the student's position:t');scanf('%d',&stu[i].position);
mark(j,i);
loop_2:printf('nnDo again?t1).Yest2).Not');
scanf('%d',&t);
if(t!=2&&t!=1)goto loop_2;
if(t==2)break;
i++;
}while(t==1);f=1;
printf('Success!!!nPress any key+Enter to menu..');scanf('%d',&r);
menu();
}
search()
{ int e;char c;extern f;
if(f==0)
{ printf('Please enter the data first!!nPress any key+Enter to menu..n ');
scanf('%s',&c);
menu();
}
loop:printf('nThe form of searching you want to choice:nt1).By schoolnt2).Bt itemnt3).To menut');
scanf('%d',&e);
switch(e)
{ case 1:search_school();break;
case 2:search_item();break;
case 3:menu();
}
if(e>4||e
printf('Press any key+Enter to menu..');scanf('%s',&c);menu();
}
search_school()
{ int x,sum=0,w=0;
struct student s;
printf('nPlease enter the name of the school that you want to search:');
scanf('%s',&s.shool);
printf_face();
for(x=0;x
if(strcmp(s.shool,stu[x].shool)==0)
{ sum+=stu[x].mark;
printf_one(x);w=1;
}
printf_sum(sum);
if(w==0)
{printf('nn*The name is wrong,press again!');search_school();}
}
search_item()
{ int x,sum=0,w=0;
struct student s;
printf('nPlease enter the name of the item that you want to search:');
scanf('%s',&s.item);
printf_face();
for(x=0;x
if(strcmp(s.item,stu[x].item)==0)
{ sum+=stu[x].mark;
printf_one(x);w=1;
}
printf_sum(sum);
if(w==0)
{ printf('nn*The name is wrong,press again!');search_item();}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -