資源簡(jiǎn)介
C語(yǔ)言學(xué)習(xí)者的經(jīng)典實(shí)例,難得可貴。通過此資源可以加深對(duì)C語(yǔ)言的理解,并掌握一定的開發(fā)經(jīng)驗(yàn)。
代碼片段和文件信息
#include?
#include
int?N1N2kk1kk2kk3;
struct?couse?*?head1;
struct?student?*?head2;
struct?couse//課程信息結(jié)構(gòu)體
{
????int?num1;
????char?name1[20];
????int?score;
????int?nelepeo;//課程已選人數(shù)
????int?Melepeo;//課程人數(shù)上限
????struct?couse?*?next;
};
struct?student//學(xué)生信息結(jié)構(gòu)體
{
????int?num2;
????char?name2[20];
????int?nelenum[50];//已選課程編號(hào)
????int?nelen;//已選課程數(shù)量
????struct?student?*?next;
};
void?Ms()
{
????for(kk1=0;kk1<1100;kk1++)
????????????????for(kk2=0;kk2<1200;kk2++)
????????????????????for(kk3=0;kk3<1200;kk3++);
}
void?keyboardc()//錄入課程子函數(shù)(從鍵盤錄入)
{
struct?couse?*p1*p2;
N1=0;
p1=p2=(struct?couse*)malloc(sizeof(struct?couse));
printf(“課程編號(hào)\t課程名稱\t學(xué)分\t課程人數(shù)上限\n“);
scanf(“%d%s%d%d“&p1->num1p1->name1&p1->score&p1->Melepeo);
p1->nelepeo=0;
head1=NULL;
while(p1->num1!=0)
{
????N1=N1+1;
????if(N1==1)head1=p1;
????else?p2->next=p1;
????p2=p1;
????p1=(struct?couse?*?)malloc(sizeof(struct?couse));
????scanf(“%d%s%d%d“&p1->num1p1->name
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件??????14572??2011-07-11?11:51??學(xué)生選課系統(tǒng)例子.cpp
-----------?---------??----------?-----??----
????????????????14572????????????????????1
評(píng)論
共有 條評(píng)論