From cf5395fa4b5be7c3895e0d9e86b4daffeb013e4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=9F=B3=E7=9A=93=E5=8D=8E?= <2873688847@qq.com> Date: Fri, 11 Jan 2019 11:41:36 +0800 Subject: [PATCH] end commit --- 学生选修课程系统设计.cpp | 267 +++++++++++++++++++++++++++++ 1 file changed, 267 insertions(+) create mode 100644 学生选修课程系统设计.cpp diff --git a/学生选修课程系统设计.cpp b/学生选修课程系统设计.cpp new file mode 100644 index 0000000..088b364 --- /dev/null +++ b/学生选修课程系统设计.cpp @@ -0,0 +1,267 @@ +#include +#include +#include +struct course//Ïȶ¨ÒåÁ½¸ö½á¹¹Ìå^_^,Ò»¸öÊǿγÌÐÅÏ¢£¬ÁíÍâÒ»¸öÊÇѧÉúÑ¡¿ÎµÄ½á¹¹Í¼¡£ +{ +int num;//¿Î³Ì±àºÅ +char name[20];//¿Î³ÌÃû³Æ +char kind[10];//¿Î³ÌÐÔÖÊ +int time;//×Üѧʱ +int ttime;//ÊÚ¿Îѧʱ +int etime;//ʵÑéÉϼ¶Ñ§Ê± +int mark;//ѧ·Ö +int term;//ѧÆÚ +}; +struct student +{ +int snum;//ѧºÅ +int cnum;//¿Î³Ì±àºÅ +char cname[20];//¿Î³ÌÃû³Æ +}; +void insert()//¿Î³ÌÐÅϢ¼Èë +{ +int mai_n(); +FILE *fp; +struct course c; +int count; +int i; +if((fp=fopen("course.txt","a+"))==NULL) +{ +printf("cannot open file\n"); +} +printf("\n ÇëÊäÈë¿Î³ÌÃÅÊý:\n"); +scanf("%d",&count); +printf("¿Î³Ì±àºÅ ¿Î³ÌÃû³Æ ¿Î³ÌÐÔÖÊ(¹«¹²¿Î/±ØÐÞ¿Î) ×Üѧʱ ÊÚ¿Îѧʱ ʵÑé»òÉÏ»úѧʱ ѧ·Ö ¿ª¿ÎѧÆÚ(Äê·Ý):\n"); +for(i=0;i5||n<0) +{ +printf("\n ÊäÈë´íÎó£¡ÇëÖØÐÂÊäÈ룡\n"); +scanf("%d",&n); +} +else w=1; +}while(w==0); +switch(n) +{ +case 1:insert();break; +case 2:browser();break; +case 3:search();break; +case 4:xuanke_information();break; +case 5:xuan_ke();break; +case 0: +printf("\n^_^ ^_^ ^_^ ^_^ ^_^ ^_^ ^_^ ^_^ ^_^ ^_^ ^_^ ^_^ ^_^ ^_^ ^_^ ^_^\n\n ¸ÐлÄúµÄʹÓÃ~~~~~ͨÐŹ¤³Ì1803--ÖÆ×÷ÈË£»Ê¯ð©»ª&&ÍõÔ½¡£"),system("pause"),exit(0); +} +} +int main(void)//µÇ¼½çÃæ +{ + int a,b,c=123,d=123; + printf("ÇëÊäÈë±¾³ÌÐò·ÀµÁ°²È«Õ˺ÅÃÜÂëµÇ¼ϵͳ(·ÀµÁ°²È«Õ˺š¢ÃÜÂëΪ123)£»\n"); //ËäȻûɶÓà + printf("Õ˺ţ»"); + scanf("%d",&a); + printf("\n"); + printf("ÃÜÂ룻"); + scanf("%d",&b); + printf("\n"); + while(a!=c) + { + printf("Õ˺ŴíÎó£¡ÇëÖØÐÂÊäÈ룡\nÕ˺ţ»"); + scanf("%d",&a); + } + while(b!=d) + { + printf("ÃÜÂë´íÎó£¡ÇëÖØÐÂÊäÈ룡\nÃÜÂ룻"); + scanf("%d",&b) ; + } +printf("µÇ¼³É¹¦^_^\n"); +system("cls");//ÇåÆÁ +mai_n();//Ö÷²Ëµ¥ +return 0; +}