91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 10KB
    文件類型: .c
    金幣: 1
    下載: 0 次
    發布日期: 2021-05-15
  • 語言: C/C++
  • 標簽: C語言??課程設計??

資源簡介

c語言課程設計,學生選課管理系統,編譯環境DevC++ 1. 本次課設小組已達到課程目的。主要熟悉C語言中結構體、指針、文件的使用。加深對C語言基礎知識的理解和掌握,并規范編程習慣,進一步增強C語言編程實踐能力,鍛煉思維邏輯和解決綜合性實際問題的能力, 2. 加深對C語言的理解,為接下來的學習打下堅實的基礎。 3. 對于想大作業這樣的工作量,一個人是很難以去完成的,通過這次大作業,充分的鍛練了我們的合作能力,以及在編程的過程中要考慮的程序的適用性,而不是像平時作業一樣任憑自己發揮。

資源截圖

代碼片段和文件信息

#include
#include
#include
#include?
struct?subject{//課程信息?
int?number;//課程編碼?
char?name[20];//課程名稱?
char?teacher[20];//教師姓名?
int?point;//課程學分?
char?place[20];//教室地點???
};
struct?system{//用戶賬號信息?
long?count;
long?password;
};
struct?student{//賬號數據?
int?count;//賬號?
char?name[20];//姓名?
char?selectclass[20];//選課1?
char?selectclass2[20];//選課2?
};
void?subjects()//顯示學科數據?
{
FILE?*fp;
struct?subject?st1[128];
int?ilen;

fp=fopen(“課程數據.txt““rb“);
if?(fp==NULL)?
{
printf(“can‘t?open?file\n“);
exit(0);
}
for(i=0;!feof(fp);i++)
fread(st1sizeof(struct?subject)1fp);
rewind(fp);
len=i-1;
printf(“序號:?課程???老師???學分?地點\n“);
fread(st1sizeof(struct?subject)lenfp);
for(i=0;i printf(“%d???:?%s???%s???%d????%s??\n“st1[i].numberst1[i].namest1[i].teacherst1[i].pointst1[i].place);
fclose(fp);
}
long?login()//用戶登入?
{
FILE?*fp;
struct?system?user[128];
int?i;
long?count;
long?password;
int?sele;?

printf(“-----------歡迎使用學生選課管理系統-----------\n“);
printf(“\n“);?
fp=fopen(“用戶信息.txt““r“);
if?(fp==NULL)?
{
printf(“can‘t?open?file\n“);
exit(0);
}
for(i=0;i<4;i++)
{
fscanf(fp“%d?%d?“&user[i].count&user[i].password);
}

printf(“請輸入賬號(提示:賬號形式為100**數據類型為整形):“);
do//賬號輸入?
{
scanf(“%d“&count);
for(i=0;i<4;i++)
{
if(user[i].count==count)
break;
}
if(i==4)
printf(“賬號輸入錯誤,請重新輸入:“);
}while(i==4);?

printf(“請輸入密碼(數據類型為整形):“);

do//密碼輸入?
{
scanf(“%d“&password);
if(password==user[i].password)????
break;
printf(“密碼輸入錯誤,請重新輸入:“);
}while(password!=user[i].password);

return?count;
}
/////////////////////////////////////////////////////////////////學生功能代碼?
void?choose1()//第一次選課?
{
int?seleilent=0;
FILE?*fp;
struct?subject?st1[128];
void?loadclass1(?int?number);

fp=fopen(“課程數據.txt““rb“);
if?(fp==NULL)?
{
printf(“can‘t?open?file\n“);
exit(0);
}?
for(i=0;!feof(fp);i++)
fread(st1sizeof(struct?subject)1fp);
rewind(fp);
len=i-1;
fread(st1sizeof(struct?subject)lenfp);

printf(“--------------一次選課-----------------\n“);
printf(“課程如下\n“);
subjects();
printf(“如果你想選擇課程,請輸入前面的序號:“);
do
{
scanf(“%d“&sele);
for(i=0;i {
if(sele==st1[i].number)
{
loadclass1(sele);
t=9;
}
}
if(t==9)
break;
printf(“輸入錯誤,請重新輸入:“);?
}while(t!=9);
}
void?choose2()//第二次選課?
{
int?seleilent=0;
FILE?*fp;
struct?subject?st1[128];
void?loadclass2(?int?number);
fp=fopen(“課程數據.txt““r“);
if?(fp==NULL)?
{
printf(“can‘t?open?file\n“);
exit(0);
}
for(i=0;!feof(fp);i++)
fread(st1sizeof(struct?subject)1fp);
rewind(fp);
len=i-1;
fread(st1sizeof(struct?subject)lenfp);
printf(“課程如下\n“);
subjects();
printf(“如果你想選擇課程,請輸入前面的序號:“);
do
{
scanf(“%d“&sele);
for(i=0;i {
if(sele==st1[i].number)
{
loadclass2(sele);

評論

共有 條評論