c語言課程設計中南大學
A. 求高斯演算法完整C語言程序,急。。。。。
中南民族大學計算機科學學院本科課程設計
B. c語言程序設計 教學設備管理系統 謝謝啦!分不是問題
#include<graphics.h>
#include<stdlib.h>
#include<stdio.h>
#include<conio.h>
#define NULL 0
#define LEN sizeof(struct equipment)
struct equipment
{long number;
char name[20];
char adr[20];
long date;
long taishu;
long price;
long amount;
char instruction[20];
struct equipment *next;
};
struct equipment *head,*equip,*p5,*p;
int n;
struct equipment *del1,*del2,*del3;
struct equipment*insert(struct equipment *head,struct equipment *p);
/*輸入函數*/
struct equipment* creat(void)
{struct equipment *p1,*p2;
n=0;
p1=p2=(struct equipment*)malloc(LEN);
printf("\n教學設備編號為0時,退出輸入!\n");
printf("輸入教學設備編號 :");
scanf("%ld",&p1->number);
printf("\n輸入設備名稱:");
scanf("%s",&p1->name);
printf("\n輸入生產廠家:");
scanf("%s",&p1->adr);
printf("\n輸入購置日期:");
scanf("%ld",&p1->date);
printf("\n輸入台數:");
scanf("%ld",&p1->taishu);
printf("\n輸入單價:");
scanf("%ld",&p1->price);
p1->amount=(p1->taishu)*(p1->price);
printf("\n輸入備注:");
scanf("%s",&p1->instruction);
head=NULL;
while(p1->number!=0)
{n=n+1;
if(n==1) head=p1;
else p2->next=p1;
p2=p1;
p1=(struct equipment*)malloc(LEN);
printf("\n輸入教學設備編號:");
scanf("%ld",&p1->number);
if(p1->number==0) break;
else
{printf("\n輸入設備名稱:");
scanf("%s",&p1->name);
printf("\n輸入生產廠家:");
scanf("%s",&p1->adr);
printf("\n輸入購置日期:");
scanf("%ld",&p1->date);
printf("\n輸入台數:");
scanf("%ld",&p1->taishu);
printf("\n輸入單價:");
scanf("%ld", &p1->price);
p1->amount=(p1->taishu)*(p1->price);
printf("\n輸入備注:");
scanf("%s",p1->instruction);}
}
p2->next=NULL;
return(head);
}
void print()
{clrscr();
gotoxy(33,0);
printf("\16[{-80|10@30,30=4(2)5****中南大學教學設備管理系統****}]");
gotoxy(3,5);
printf("設備編號 設備名稱 生產廠家 購置日期 台數 單價 金額 備注\n");}
void print1()
{int i,j;
for(i=0;i<=8;i++)
line(70*i+16,60,70*i+16,60+36*(n+1));
for(j=0;j<=n+1;j++)
line(16,60+36*j,70*8+16,60+36*j);}
/*顯示函數*/
void output(struct equipment* head)
{struct equipment*p;
p=head;
printf(" ");
if(head!=NULL)
do
{printf("\n %-9ld%-9s%-9s%-9ld%-9ld%-9ld%-9ld%-9s \n",p->number,p->name,p->adr,p->date,p->taishu,p->price,p->amount,p->instruction);
p=p->next;}while(p!=NULL);
printf(" ");
getch();}
/*修改函數*/
void change(struct equipment* head)
{struct equipment *p;
long num;
cleardevice();
for(;;)
{
printf("\n請輸入要修改的設備編號:");
scanf("%ld",&num);
p=head;
while(num!=p->number&&p->next!=NULL)
{p=p->next;}
if(num!=p->number)
{printf("\n對不起,無此記錄!按任意鍵返回!");
getch();
break;}
else
{printf("\n請輸入新的設備記錄:");
printf("\n輸入教學設備編號:");
scanf("%ld",&p->number);
printf("\n輸入教學設備名稱:");
scanf("%s",&p->name);
printf("\n輸入生產廠家:");
scanf("%s",&p->adr);
printf("\n輸入購置日期:");
scanf("%ld",&p->date);
printf("\n輸入台數:");
scanf("%ld",&p->taishu);
printf("\n輸入單價:");
scanf("%ld",&p->price);
p->amount=(p->taishu)*(p->price);
printf("\n輸入備注:");
scanf("%s",p->instruction);
printf("\n是否繼續退出,Y/N?");
if(getch()!='y') break;
}
}}
/*查找函數*/
void search(struct equipment* head)
{ struct equipment *p;
char choice;
long key;
do
{clrscr();
if(head==NULL)
printf("\n 無此記錄!");
printf("\n請輸入要查找的設備編號:");
scanf("%ld",&key);
p=head;
while(key!=p->number&&p->next!=NULL)
{p=p->next;}
if(key==p->number)
{print();
print1();
printf("\n %-9ld%-9s%-9s%-9ld%-9ld%-9ld%-9ld%-9s",p->number,p->name,p->adr,p->date,p->taishu,p->price,p->amount,p->instruction);
printf("\n");}
else
{printf("\n無此編號,請按任意鍵返回!");
getch();}
printf("\n您是否需要繼續查找?(y/n)\n");
choice=getch();
}while(choice=='y');
}
/*刪除函數*/
struct equipment *del(struct equipment *head)
{ struct equipment *p1,*p2;
long number;
int b=0;
do
{clrscr();
if(head==NULL)
{printf("\n無此記錄!\n");
return(head);}
else
{b=0;
if(del1==NULL) b=b+1;
if(del2==NULL) b=b+1;
if(del3==NULL) b=b+1;
if(b!=0)
printf("\n回收站還有%d的空間!",b);
else
printf("\n回收站已滿,無法再刪除!");
printf("\n請輸入要刪除的教學設備編號:");
scanf("%ld",&number);
p1=head;
while(number!=p1->number&&p1->next!=NULL)
{p2=p1;
p1=p1->next; }
if(number==p1->number)
{printf("\n進行邏輯刪除還是物理刪除,Y/N?");
if(getch()=='y')
{if(del1==NULL) del1=p1;
else if(del2==NULL) del2=p1;
else del3=p1;}
if(p1==head) head=p1->next;
else p2->next=p1->next;
printf("\n已刪除設備編號%ld記錄!",number);
b=b-1;}
else
{printf("\n無此設備記錄!");
getch();}
printf("\n是否繼續刪除/Y/N?");
}
}while(getch()=='y');
getch();
return(head);
}
/*恢復函數*/
struct equipment *recover(struct equipment* head)
{ struct equipment *p0,*p1,*p2;
long rec_num,a=0;
cleardevice();
gotoxy(1,3);
do{printf("\n可恢復的設備編號:");
if(del1!=NULL)
{a=a+1;printf("\n%ld",del1->number); }
if(del2!=NULL)
{a=a+1;printf("\n%ld",del2->number);}
if(del3!=NULL)
{a=a+1;printf("\n%ld",del3->number); }
if(a==0)
{printf("\n沒有可恢復的數據,請按任意鍵退出!");
getch();
return(head); }
printf("\n請輸入要恢復的教學設備編號:");
scanf("%ld",&rec_num);
if(rec_num==del1->number)
{p0=del1;
del1=NULL;}
else if(rec_num==del2->number)
{p0=del2;
del2=NULL;}
else if(rec_num==del3->number)
{p0=del3;
del3=NULL;}
else {printf("\n輸入錯誤,按任意鍵返回!");
getch();
return(head);}
p1=head;
if(head==NULL)
{head=p0;p0->next=NULL;}
else
{while((p0->number>p1->number)&&(p1->next!=NULL))
{p2=p1;
p1=p1->next;}
if(p0->number<p1->number)
{if(head==p1){head=p0;p0->next=p1;}
else p2->next=p0;
p0->next=p1;
} else
{p1->next=p0;
p0->next=NULL;}}
n=n+1;
output(head);
printf("\n恢復成功,請按任意鍵返回!");
printf("\n是否繼續進行恢復Y/N?");
}while(getch()=='y');
getch();
return(head);
}
/*添加函數*/
struct equipment *insert(struct equipment* head,struct equipment *p)
{
char choice;
p=(struct equipment*)malloc(LEN);
do
{
clrscr();
printf("\n請輸入新的教學設備資料:");
printf("\n輸入編號:");
scanf("%ld",&p->number);
printf("\n輸入名稱:");
scanf("%s",p->name);
printf("\n輸入生產廠家:");
scanf("%s",p->adr);
printf("\n輸入購置日期:");
scanf("%ld",&p->date);
printf("\n輸入台數:");
scanf("%ld",&p->taishu);
printf("\n 輸入單價:");
scanf("%ld",&p->price);
p->amount=(p->taishu)*(p->price);
printf("\n輸入備注:");
scanf("%s",p->instruction);
printf("\n");
if(n==0)
{ n=n+1;
head=p; }
else
{p->next=head;head=p;n++;}
printf("\n您是否要繼續添加?(y/n)\n");
}while(getch()=='y');
return(head);
}
/*統計函數*/
void count(struct equipment* head)
{ int sum1=0,sum2=0,sum3=0,sum4=0,sum5=0,sum6=0,sum7=0,sum8=0;
struct equipment* p;
p=head;
while(p)
{ for(p=head;p!=NULL;p=p->next)
{ sum1+=p->taishu;
sum2+=p->amount;
if(p->amount<200)
{ sum3+=p->taishu;sum4+=p->amount; }
else
if(p->price<800)
{ sum5+=p->taishu;sum6+=p->amount; }
else
{ sum7+=p->taishu;sum8+=p->amount; }
}
}
output(head);
printf("\n 合計 %d %d\n",sum1,sum2);
n=n+1;
print1();
n=n-1;
printf("\n");
printf("\n");
printf("\n 200元以下的設備總台數及總金額: %d %d",sum3,sum4);
printf("\n 200--800元之間的設備總台數及總金額: %d %d",sum5,sum6);
printf("\n 800元以上的設備總台數及總金額: %d %d",sum7,sum8);
getch();
}
/*保存函數*/
void save(struct equipment *head)
{ FILE *fp;
struct equipment *p;
char name[20];
p=head;
cleardevice();
printf("\n請輸入要保存的文件名:");
scanf("%s",name);
if((fp=fopen(name,"wb"))==NULL)
{printf("\n對不起!不能建立新文件!按任意鍵返回!");
getch();
return;}
while(p->number!=NULL)
{fwrite(p,LEN,1,fp);
p=p->next;}
printf("\n保存結束,請按任意鍵返回!");
fclose(fp);
getch();}
/*打開函數*/
struct equipment *dakai(void)
{ struct equipment *head, *p1,*p2 ;
char name[20];
FILE *fp=NULL;
cleardevice();
p1=p2=(struct equipment *)malloc(LEN);
printf("\n請輸入要打開的文件名:");
head=p1;
scanf("%s",name);
if((fp=fopen(name,"rb"))==NULL)
{printf("\n對不起,沒有該文件!請按任意鍵返回!");
getch();}
fread(p1,LEN,1,fp);
while(!feof(fp))
{p2->next=p1;
p2=p1;
p1=(struct equipment*)malloc(LEN);
fread(p1,LEN,1,fp);n++;};
p2->next=NULL;
fclose(fp);
output(head);
printf("\n文件已輸出,請按任意鍵返回!");
getch();
return(head);
}
C. 中南大學c語言試題
C
語言程序設計試卷
一、單項選擇題(每題1分,共20分)
1.
C語言規定:在一個源程序中,main函數的位置(
①
)。
A.
必須在最開始
B.
必須在系統調用的庫函數的後面
C.
可以任意
D.
必須在最後
2.
下面四個選項中,均是合法浮點數的選項是(
①
)。
A.
+1e+1
5e-9.4
03e2
B.
-.60
12e-4
-8e5
C.
123e
1.2e-.4
+2e-1
D.
-e3
.8e-4
5.e-0
3.
若a=-14,b=3,則條件表達式
a
#define
F(y)
8.19-y
#define
PRINT(a)
printf("%d",(int)(a))
void
main(void)
{
int
x=2;
PRINT(x*F(3));
}
A.
10
B.
13
C.
11
D.
報錯
11.
以下程序中編譯和運行結果均正確的一個是(
①
)。
A.
A.
void
main(void)
{
union
{
int
n;
float
x;
}
comm={1};
printf("%d",comm.n);
}
B.
B.
void
main(void)
{
union
{
int
n;
float
x;
}
comm={12.5};
printf("%f",comm.x);
}
C.
C.
void
main(void)
{
union
{
float
x;
int
n;
}
comm={12.5}
printf("%f",comm.x);
}
D.
D.
void
main(void)
{
union
{
int
n;
float
x;
}
comm=5;
printf("%
D. c語言程序設計 中南大學陳松喬版課後答案
^^^^^^^^^^^^^^^^^^^
現在很流行問威客問題哦!
如果你有需求的話可以去萬能網發任務哦!
很方便的
希望幫到你了哈!
E. 有沒有中南民族大學生物醫學工程c語言程序設計試題
親,你的這個是多少字的哈
F. 中南大學C語言課程設計圖書管理系統
尼瑪 我也糾結中。。。
G. 中南大學計算機程序設計學的是C語言嗎
c語言是基礎哦 就像1+1=2一樣
H. 中南大學計算機網路課程設計不做可以嗎
不可以,影響成績
I. 中南大學c語言上機考試考什麼程序
第一題是填空題(3個)30分,第二題改錯(兩個位置)30分,第三題程序設計40分(一般考比較基礎的程序)。建議你買本上機指導書看,應該是沒什麼問題的。