當前位置:首頁 » 課程大全 » c課程設計下載

c課程設計下載

發布時間: 2021-01-30 11:01:14

A. C語言課程設計的源代碼在哪裡有下載啊

http://wstatic.xunlei.com/index2.htm?search=C語言來源
看看這兒有嗎?

B. c課程設計

#include<iostream>
#include<string.h>
#include<fstream>
using namespace std;
class controlloer //圖書管理員
{
private:
int number;
int age;
char name[20];
public:
controlloer();
controlloer(int c,int a,char b[20] );
int getnumber();
int getage();
char *getname();
void reworkage(int i);
void reworkname(char a[20]);
};
controlloer::controlloer()
{
number=0;
char b[20]="no one";
age=0;
strcpy(name,b);
}
controlloer::controlloer(int c,int a,char b[20])
{
number=c;
age=a;
strcpy(name,b);
}
int controlloer::getage()
{return age;}
char *controlloer::getname()
{return name;}
int controlloer::getnumber()
{return number;}
void controlloer::reworkage(int i)
{age=i;}
void controlloer::reworkname(char a[20])
{strcpy(name,a);}
class reader //讀者(學生,老師)
{
private:
int number;
int age;
char name[20];
char ye[20];
char borrowbook[20];

public:
reader();
reader(int c,int a,char b[20],char d[20],char e[20]);
int getnumber();
int getage();
char *getye();
char *getname();
char * getborrowbook();
void reworkborrowbook(char a[20]);
};
reader::reader()
{
char a[20]="沒有人";
char b[20]="無職稱";
char c[20]="沒有借書";
number=0;
age=0;
strcpy(name,a);
strcpy(ye,b);
strcpy(borrowbook,c);
}
reader::reader(int a,int c,char b[20],char d[20],char e[20])
{
number=a;
age=c;
strcpy(name,b);
strcpy(ye,d);
strcpy(borrowbook,e);
}
int reader::getnumber(){return number;}
int reader::getage(){return age;}
char *reader::getye(){return ye;}
char *reader::getname(){return name;}
char * reader::getborrowbook(){return borrowbook;}
void reader::reworkborrowbook(char a[20]){strcpy(borrowbook,a);}
struct book //圖書
{
int num;
char name[20];
char people[20];
};
void store() //存入圖書信息
{
int i,c,b;
char a[20],d[20];
ifstream file("num.txt");
file>>b;
file.close();
cout<<"現有的圖書個數:";
cout<<b<<endl;
cout<<"請輸入你要輸入的圖書信息個數:"<<endl;
cin>>c;
book *shu=new book[c];
cout<<"輸入圖書信息(編號,名字,作者名:)"<<endl;
for(i=0;i<c;i++)
{
cin>>shu[i].num;
cin>>a>>d;
strcpy(shu[i].name,a);
strcpy(shu[i].people,d);
b++;
}
ofstream outfile("stu.txt",ios_base::app);
for(i=0;i<c;i++)
{
outfile.write((char *)&shu[i],sizeof(shu[i]));
}
outfile.close();
cout<<"存入成功!"<<endl;
ofstream tfile("num.txt");
tfile<<b;
tfile.close();
}
void outbook() //輸出圖書信息
{
int i,h,j,g,z;
char k ;
ifstream tfile("num.txt");
if(!tfile)
{
cout<<" 文件不存在! ";
tfile.close();
cout<<"你是否想創建(輸入Y或N)";
cin>>k;
if(k=='N') exit(0);
else {ofstream tfile("num.txt");g=0;tfile<<g;}
}
else tfile>>g;
cout<<"本圖書館已經有"<<g<<"本圖書"<<endl;
if(g==0)
{cout<<"圖書館里沒有書!"<<endl;exit(0);}
else
{ book *shu=new book[g];
ifstream is("stu.txt",ios_base::binary);
if(is)
{

for(i=0;i<g;i++)
{
is.read((char *)&shu[i],sizeof(shu[i]));
}
for(i=0;i<g;i++)
{
cout<<"編號 名字 作者名"<<endl;
cout<<shu[i].num<<" "<<shu[i].name<<" "<<shu[i].people<<endl;
}
}
else
{
cout<<"ERROR:cannot open file'stu.txt'"<<endl;
}
is.close();
ifstream file("readernum.txt");
if(file) { file>>z; file.close();}
else { cout<<"沒有文件";}
cout<<"已有的讀者個數:";
cout<<z<<endl;
cout<<"輸入你的編號:";
cin>>j;
cout<<"你想借哪本書(輸入編號):";
cin>>h;
reader *people=new reader[z];
ifstream out("reader.txt",ios_base::binary);
if(out)
{

for(i=0;i<z;i++)
{
out.read((char *)&people[i],sizeof(people[i]));
}
}
else
{
cout<<"ERROR:cannot open file'stu.txt'"<<endl;
}
out.close();
people[j-1].reworkborrowbook(shu[h-1].name);
cout<<"編號 年齡 名字 職業 借書情況 "<<endl;
cout<<people[j-1].getnumber()<<" "<<people[j-1].getage()<<" "<<people[j-1].getname()<<" "<<people[j-1].getye()<<" "<<people[j-1].getborrowbook()<<endl;
ofstream outfile("reader.txt",ios_base::binary);
for(i=0;i<z;i++)
{
outfile.write((char *)&people[i],sizeof(people[i]));}
outfile.close();
}
cout<<"借閱成功!";
}
void controller() //圖書管理員信息
{
int b,i,d,h=0;
ifstream file("controlloernum.txt");
if(file) { file>>b; file.close();cout<<"圖書管理員個數:"<<b<<endl;}
else
{
cout<<"沒有圖書管信息理員"<<endl;
cout<<"你是否想創建(請輸入Y或N):";
cin>>d;
if(d='y') {ofstream infile("controlloernum.txt");infile<<h;exit(0);}
else exit(0);
}
ifstream is("controlloer.txt",ios_base::binary);
if(is)
{
controlloer *bookpeople=new controlloer[b];
for(i=0;i<b;i++)
{
is.read((char *)&bookpeople[i],sizeof(bookpeople[i]));
}
for(i=0;i<b;i++)
{
cout<<"編號 年齡 名字 "<<endl;
cout<<bookpeople[i].getnumber()<<" "<<bookpeople[i].getage()<<" "<<bookpeople[i].getname()<<endl;
}
}

else
{
cout<<"ERROR:cannot open file'stu.txt'"<<endl;
cout<<"沒有這個文件夾"<<endl;
cout<<"你是否想創建(請輸入Y或N):";
cin>>d;
if(d='y') {ofstream infile("controlloer.txt");exit(0);}
else exit(0);

}
is.close();
}
void libary() //圖書館的總信息
{
system("cls");
system("color 2e");
cout<<" "<<endl;
cout<<" "<<endl;
cout<<" "<<endl;
cout<<"學校圖書館由本部圖書館及彭州校區圖書館組成.館舍面積41048平方米";
cout<<" (其中現有館舍面積11578 平方米,在建圖書館館舍面積29470平方米),";
cout<<"各院系資料室面積1120平方米。學校擁有紙質文獻198萬余冊, ";
cout<<"生均81.17冊,電子文獻161.7萬余種。近三年校圖書館每年進書量均超過15萬冊."<<endl;
}
void storecontroller() //存入新的管理員的信息
{
int i,b,c,h=0;
char a[20],d;
ifstream file("controlloernum.txt");
if(file)
{
file>>b; file.close();cout<<"已有的圖書管理員個數:";
cout<<b<<endl;
}
else
{
cout<<"沒有圖書管信息理員"<<endl;
cout<<"你是否想創建(請輸入y或n):";
cin>>d;
if(d=='y')
{ofstream infile("controlloernum.txt");infile<<h;infile.close();b=0;}
else exit(0) ;
}
ofstream outfile("controlloer.txt",ios::app);
cout<<"請輸入圖書管理員的編號和年齡,名字:";
cin>>c>>i>>a;
controlloer bookpeople(c,i,a);
cout<<"編號 年齡 名字 "<<endl;
cout<<bookpeople.getnumber()<<" "<<bookpeople.getage()<<" "<<bookpeople.getname()<<endl;
outfile.write((char *)&bookpeople,sizeof(bookpeople));
outfile.close();
b++;
ofstream tfile("controlloernum.txt");
tfile<<b;
tfile.close();
cout<<"保存成功!";
}
void reworkcontrolloer() ///修改圖書管理員
{
int i,b,h,j,g;
char d[20];
ifstream file("controlloernum.txt");
if(file) { file>>b; file.close();}
else {cout<<"沒有圖書管信息理員"; exit(0);}
cout<<"已有的圖書管理員個數:";
cout<<b<<endl;
controlloer *bookpeople=new controlloer[b];
ifstream is("controlloer.txt",ios_base::binary);
if(is)
{
for(i=0;i<b;i++)
{
is.read((char *)&bookpeople[i],sizeof(bookpeople[i]));
}
for(i=0;i<b;i++)
{
cout<<"編號 年齡 名字 "<<endl;
cout<<bookpeople[i].getnumber()<<" "<<bookpeople[i].getage()<<" "<<bookpeople[i].getname()<<endl;
}
}
else
{
cout<<"ERROR:cannot open file'stu.txt'"<<endl;
}
is.close();
cout<<"請輸入你要修改的管理員編號:";
cin>>h;
cout<<"輸入年齡,名字:";
cin>>g>>d;
bookpeople[h-1].reworkage(g);
bookpeople[h-1].reworkname(d);
cout<<"該了後的名字:"<<bookpeople[h-1].getname();
ofstream tfile("controlloer.txt",ios_base::binary);
for(j=0;j<b;j++)
{
tfile.write((char *)&bookpeople[j],sizeof(bookpeople[j]));
}
tfile.close();
}

C. c語言課程設計

#include<iostream>
#include<fstream>
#include<conio.h>
using namespace std;
class Librarian //圖書管理員類
{
public:
Librarian();
Librarian(int n,int j,char na[20],int w );
int getnumber();
int getjobage();
char *getname();
int getwages();
void resetjobage(int j);
void resetwages(int w);
void resetname(char na[20]);
private:
int number;
int jobage;
char name[20];
int wages;
};
Librarian::Librarian() //其函數的實現
{
number=0;
char b[20]="no one";
jobage=0;
strcpy(name,b);
}
Librarian::Librarian(int n,int j,char na[20],int w)
{
number=n;
jobage=j;
strcpy(name,na);
wages=w;
}
int Librarian::getjobage()
{return jobage;}
char *Librarian::getname()
{return name;}
int Librarian::getnumber()
{return number;}
int Librarian::getwages()
{return wages;}
void Librarian::resetjobage(int j)
{
jobage=j;
}
void Librarian::resetname(char na[20])
{
strcpy(name,na); }
void Librarian::resetwages(int w)
{
wages=w;
}
class reader //讀者類
{
private:
int number;
int age;
char name[20];

char borrowbook[20];
public:
reader();
reader(int c,int a,char b[20],char e[20]);
int getnumber();
int getage();
char *getname();
char * getborrowbook();
void reworkborrowbook(char a[20]);
};
reader::reader() //其函數的實現
{
char a[20]="沒有人";
char c[20]="沒有借書";
number=0;
age=0;
}
reader::reader(int a,int c,char d[20],char e[20])
{
number=a;
age=c;
strcpy(name,d); strcpy(borrowbook,e);
}
int reader::getnumber(){return number;}
int reader::getage(){return age;}
char *reader::getname(){return name;}
char * reader::getborrowbook(){return borrowbook;}
void reader::reworkborrowbook(char a[20]){strcpy(borrowbook,a);} struct book //圖書的結構體
{
int num; char name[20];
char writer[20];
}; void outbookinf() //輸出所有圖書信息
{
int i;
ifstream infile("allbook.txt",ios::in);
char line[50];
cout<<"書名 "<<'\t'<<" 書號 "<<'\t'<<" 作者 "<<endl;
for(i=1;i<=10;i++)
{
infile.getline(line,50,'\n');
cout<<line<<endl;
}
infile.close();
}
void serchLaninf() //圖書管理員信息函數
{
int n,i;
ifstream file("serchLaninf.txt");
if(file) { file>>n; file.close();}
else {cout<<" ★ 沒有圖書管信息理員"; exit(0);}
ifstream is("controlloer.txt",ios_base::binary);
if(is)
{
Librarian *A=new Librarian[n];
for(i=0;i<n;i++)
{
is.read((char *)&A[i],sizeof(A[i]));
}
for(i=0;i<n;i++)
{
cout<<"編號"<<'\t'<<"工齡"<<'\t'<<"名字"<<'\t'<<"工資"<<endl;
cout<<A[i].getnumber()<<"\t"<<A[i].getjobage()<<"\t"<<A[i].getname()<<"\t"<<A[i].getwages()<<endl;
}
}
else
{
cout<<"txt文件打開出錯'"<<endl;
}
is.close();
}
void libary() //圖書館的總信息
{
system("cls");
system("color 2e");
cout<<" "<<endl;
cout<<" "<<endl;
cout<<" "<<endl;
cout<<" ★★ 本校圖書館由校本部圖書館及彭州校區圖書館組成\n ★★ 圖書館總面積達了****平方米\n";
cout<<" ★★ 本館現在有: ****類書籍****萬冊\n \t\t****類書籍****萬冊\n \t\t****類書籍****萬冊\n \t\t****類書籍****萬冊\n";
cout<<" ★★ 圖書館現有工作人員***名\n";
cout<<" ★★ 圖書館現有的現代化設備價值超過****萬元\n"<<endl;
}
void storelibrarian() //存入新的管理員的信息
{
int age,n,num,wage;
char name[20];
ifstream file("serchLaninf.txt");
if(file) { file>>n; file.close();}
else { n=0;}
cout<<" ★ 已有的圖書管理員個數:";
cout<<n<<endl;
cout<<" ★ 請輸入新圖書管理員的編號和工齡,名字和工資:";
cin>>num>>age>>name>>wage;
Librarian A(num,age,name,wage);
cout<<"編號 工齡 名字 工資 "<<endl;
cout<<A.getnumber()<<" "<<A.getjobage()<<" "<<A.getname()<<" "<<A.getwages()<<endl;
ofstream outfile("controlloer.txt",ios_base::app );
outfile.write((char *)&A,sizeof(A));
outfile.close();
n++;
ofstream tfile("serchLaninf.txt");
tfile<<n;
tfile.close();
cout<<" ★ 保存成功!";
} void reLaninf() //修改圖書管理員
{
int i,n,h,jobage,wage,j;
char name[20];
ifstream file("serchLaninf.txt");
if(file) { file>>n; file.close();}
else {cout<<" ★ 沒有圖書管信息理員"; <br>exit(0);}
cout<<" ★ 已有的圖書管理員個數:";
cout<<n<<endl;
Librarian *A=new Librarian[n];
ifstream is("controlloer.txt",ios_base::binary);
if(is)
{
for(i=0;i<n;i++)
{
is.read((char *)&A[i],sizeof(A[i]));
}
for(i=0;i<n;i++)
{
cout<<"編號 工齡 名字 工資"<<endl;
cout<<A[i].getnumber()<<" "<<A[i].getjobage()<<" "<<A[i].getname()<<" "<<A[i].getwages()<<endl;
}
}
else
{
cout<<" ★ 打開文件出錯"<<endl;
}
is.close();
cout<<" ★ 請選擇你要修改的管理員編號:";
cin>>h;
cout<<" ★ 輸入新的工齡,名字,工資:";
cin>>jobage>>name>>wage;
A[h-1].resetjobage(jobage);
A[h-1].resetname(name);
A[h-1].resetwages(wage);
cout<<" ★ 該管理員修改後的名字是:"<<A[h-1].getname()<<" 工齡是:"<<A[h-1].getjobage()<<" 工資是:"<<A[h-1].getwages()<<endl;
ofstream tfile("controlloer.txt",ios_base::binary);
for(j=0;j<n;j++)
{
tfile.write((char *)&A[j],sizeof(A[j]));
}
tfile.close();
} void aadbook() //新增圖書
{
int num;char name[12];char writer[10];int n;
a:
ofstream fout("allbook.txt",ios::app);
cout<<" ★ 請錄入圖書信息:"<<endl;
cout<<"書名"<<'\t'<<"書號 "<<'\t'<<" 作者 "<<endl;
cin>>name;fout<<name<<'\t';
cin>>num;fout<<num<<'\t';
cin>>writer;fout<<writer<<'\n';
fout.close();
cout<<" ★ 是否繼續錄入? 1.是 2.否"<<endl;
cin>>n;
if(n==1)
goto a;
else
{void studentland(); <br>studentland();}
} void delate() //刪除函數
{ int m;
cout<<" ★ 選擇操作選項: "<<endl;
cout<<" 1.刪除全部信息"<<endl;
cout<<" 2.單個刪除"<<endl;
cin>>m;
if(m==1)
{ofstream file("allbook.txt",ios::trunc); <br>cout<<" ★ 全部刪除完畢,按任意鍵返回!"<<endl; <br>file.close(); <br>getch(); <br>system("cls"); <br>void studentland(); <br>studentland(); <br>}
char str[10][80],buf[20];
a:
int i=0,flag=100,c=0; ifstream fin("allbook.txt");
if(!fin){
cout<<" ★ 文件打開失敗!"<<endl;
getch();
system("cls");
void studentland();
studentland();
}
cout<<" ★ 請輸入你要刪除的書名:"<<endl;
cin>>buf;
strcat(buf,"\t"); while(fin.getline(str[i],80))
{
if(strncmp(str[i],buf,strlen(buf))==0)
{
flag=i;
}
i++;
} fin.close(); if(flag==100)
{
cout<<" ★ 沒有你所要刪除的書籍!重新按 1. 否則 0 : "<<endl;
int b;
cin>>b;
if(b==1)goto a;
else c=1;
}
if(c==0){
ofstream fout("allbook.txt");
for(int j=0;j<i;j++){
if(j==flag)continue;
fout<<str[j]<<endl;
}
fout.close();
cout<<" ★ 你要刪除的書籍的信息已刪除,繼續按 1. 否則按 0 :"<<endl;
int b;
cin>>b;
if(b==1)goto a;
}
cout<<" ★ 操作已經結束,按任意鍵返回......"<<endl;
getch();
system("cls");
void studentland();
studentland();
}

D. 急求《c語言課程設計案例精編》電子書,急求!!!!最好是pdf!

以我自身經歷來看,感覺看視頻比看書效率高,畢竟理科知識不像是文科的,看書效率太低了。可能一個很簡單的知識點,自己看書得半個小時,但是懂的人就講幾句話,就能明白了。所以相比之下,還是視頻效率比看書高。選擇個適合自己的就能學懂C了。我當初看的是夏老師的,感覺挺適合我這樣初學者的。他講的不繁瑣啰嗦,都是重點,而且思維原理講的最好。能讓我理解,我感覺這點很重要。比之前看的什麼郝斌曾怡金文的那些繁瑣啰嗦聽不出重點的好多了。

E. C語言課程設計文件

你好
你可以試試,分不要緊。
#define N 200
#include <graphics.h>
#include <stdlib.h>
#include <dos.h>
#define LEFT 0x4b00
#define RIGHT 0x4d00
#define DOWN 0x5000
#define UP 0x4800
#define ESC 0x011b
int i,key;
int score=0;/*得分*/
int gamespeed=50000;/*游戲速度自己調整*/
struct Food
{
int x;/*食物的橫坐標*/
int y;/*食物的縱坐標*/
int yes;/*判斷是否要出現食物的變數*/
}food;/*食物的結構體*/
struct Snake
{
int x[N];
int y[N];
int node;/*蛇的節數*/
int direction;/*蛇移動方向*/
int life;/* 蛇的生命,0活著,1死亡*/
}snake;
void Init(void);/*圖形驅動*/
void Close(void);/*圖形結束*/
void DrawK(void);/*開始畫面*/
void GameOver(void);/*結束游戲*/
void GamePlay(void);/*玩游戲具體過程*/
void PrScore(void);/*輸出成績*/
/*主函數*/
void main(void)
{
Init();/*圖形驅動*/
DrawK();/*開始畫面*/
GamePlay();/*玩游戲具體過程*/
Close();/*圖形結束*/
}
/*圖形驅動*/
void Init(void)
{
int gd=DETECT,gm;
initgraph(&gd,&gm,"c:\\tc");
cleardevice();
}
/*開始畫面,左上角坐標為(50,40),右下角坐標為(610,460)的圍牆*/
void DrawK(void)
{
/*setbkcolor(LIGHTGREEN);*/
setcolor(11);
setlinestyle(SOLID_LINE,0,THICK_WIDTH);/*設置線型*/
for(i=50;i<=600;i+=10)/*畫圍牆*/
{
rectangle(i,40,i+10,49); /*上邊*/
rectangle(i,451,i+10,460);/*下邊*/
}
for(i=40;i<=450;i+=10)
{
rectangle(50,i,59,i+10); /*左邊*/
rectangle(601,i,610,i+10);/*右邊*/
}
}
/*玩游戲具體過程*/
void GamePlay(void)
{
randomize();/*隨機數發生器*/
food.yes=1;/*1表示需要出現新食物,0表示已經存在食物*/
snake.life=0;/*活著*/
snake.direction=1;/*方嚮往右*/
snake.x[0]=100;snake.y[0]=100;/*蛇頭*/
snake.x[1]=110;snake.y[1]=100;
snake.node=2;/*節數*/
PrScore();/*輸出得分*/
while(1)/*可以重復玩游戲,壓ESC鍵結束*/
{
while(!kbhit())/*在沒有按鍵的情況下,蛇自己移動身體*/
{
if(food.yes==1)/*需要出現新食物*/
{
food.x=rand()%400+60;
food.y=rand()%350+60;
while(food.x%10!=0)/*食物隨機出現後必須讓食物能夠在整格內,這樣才可以讓蛇吃到*/
food.x++;
while(food.y%10!=0)
food.y++;
food.yes=0;/*畫面上有食物了*/
}
if(food.yes==0)/*畫面上有食物了就要顯示*/
{
setcolor(GREEN);
rectangle(food.x,food.y,food.x+10,food.y-10);
}
for(i=snake.node-1;i>0;i--)/*蛇的每個環節往前移動,也就是貪吃蛇的關鍵演算法*/
{
snake.x[i]=snake.x[i-1];
snake.y[i]=snake.y[i-1];
}
/*1,2,3,4表示右,左,上,下四個方向,通過這個判斷來移動蛇頭*/
switch(snake.direction)
{
case 1:snake.x[0]+=10;break;
case 2: snake.x[0]-=10;break;
case 3: snake.y[0]-=10;break;
case 4: snake.y[0]+=10;break;
}
for(i=3;i<snake.node;i++)/*從蛇的第四節開始判斷是否撞到自己了,因為蛇頭為兩節,第三節不可能拐過來*/
{
if(snake.x[i]==snake.x[0]&&snake.y[i]==snake.y[0])
{
GameOver();/*顯示失敗*/
snake.life=1;
break;
}
}
if(snake.x[0]<55||snake.x[0]>595||snake.y[0]<55||
snake.y[0]>455)/*蛇是否撞到牆壁*/
{
GameOver();/*本次游戲結束*/
snake.life=1; /*蛇死*/
}
if(snake.life==1)/*以上兩種判斷以後,如果蛇死就跳出內循環,重新開始*/
break;
if(snake.x[0]==food.x&&snake.y[0]==food.y)/*吃到食物以後*/
{
setcolor(0);/*把畫面上的食物東西去掉*/
rectangle(food.x,food.y,food.x+10,food.y-10);
snake.x[snake.node]=-20;snake.y[snake.node]=-20;
/*新的一節先放在看不見的位置,下次循環就取前一節的位置*/
snake.node++;/*蛇的身體長一節*/
food.yes=1;/*畫面上需要出現新的食物*/
score+=10;
PrScore();/*輸出新得分*/
}
setcolor(4);/*畫出蛇*/
for(i=0;i<snake.node;i++)
rectangle(snake.x[i],snake.y[i],snake.x[i]+10,
snake.y[i]-10);
delay(gamespeed);
setcolor(0);/*用黑色去除蛇的的最後一節*/
rectangle(snake.x[snake.node-1],snake.y[snake.node-1],
snake.x[snake.node-1]+10,snake.y[snake.node-1]-10);
} /*endwhile(!kbhit)*/
if(snake.life==1)/*如果蛇死就跳出循環*/
break;
key=bioskey(0);/*接收按鍵*/
if(key==ESC)/*按ESC鍵退出*/
break;
else
if(key==UP&&snake.direction!=4)
/*判斷是否往相反的方向移動*/
snake.direction=3;
else
if(key==RIGHT&&snake.direction!=2)
snake.direction=1;
else
if(key==LEFT&&snake.direction!=1)
snake.direction=2;
else
if(key==DOWN&&snake.direction!=3)
snake.direction=4;
}/*endwhile(1)*/
}
/*游戲結束*/
void GameOver(void)
{
cleardevice();
PrScore();
setcolor(RED);
settextstyle(0,0,4);
outtextxy(200,200,"GAME OVER");
getch();
}
/*輸出成績*/
void PrScore(void)
{
char str[10];
setfillstyle(SOLID_FILL,YELLOW);
bar(50,15,220,35);
setcolor(6);
settextstyle(0,0,2);
sprintf(str,"score:%d",score);
outtextxy(55,20,str);
}
/*圖形結束*/
void Close(void)
{
getch();
closegraph();
}
謝謝。

F. 請問哪有《C程序設計基礎課程設計》的電子版下載,浙大的。

好像沒有,你花點錢買張光碟吧,我看了下好像19元就行了

G. c語言課程設計下載哪裡有

網路文庫,豆丁網,還有CSDN。我一般用幾個網站的,當然最好自己做,練習一下挺不錯的,不要依賴這些資源哦~哈哈~
加油~

H. C課程設計 文件合並

已經排好序的字元串耶,為什麼你提供的字元串未排序呢?
假設以#結尾
#include<stdio.h>
#include<string.h>
void main(){
char ch[2][100][100];
FILE *A,*B,*C;
int i,j,s1,s2,l;
A=fopen("A.txt","r");
B=fopen("B.txt","r");
C=fopen("C.txt","w");
for(i=0;i<100;i++){
fscanf(A,"%s",ch[0][i]);
if(!strcmp(ch[0][i],"#"))break;
}s1=i;if(i==100)s1=i-1;
for(i=0;i<100;i++){
fscanf(B,"%s",ch[1][i]);
if(!strcmp(ch[1][i],"#"))break;
}s2=i;if(i==100)s2=i-1;
for(i=0,j=0;;){
if(i==s1){
for(;j<s2;j++)fprintf(C,"%s\n",ch[1][j]);
break;
}if(j==s2){
for(;i<s1;i++)fprintf(C,"%s\n",ch[0][i]);
break;
}
l=strcmp(ch[0][i],ch[1][j]);
if(!l){
fprintf(C,"%s\n%s\n",ch[0][i],ch[1][j]);
i++;j++;
}else if(l<0){
fprintf(C,"%s\n",ch[0][i]);
i++;
}else{
fprintf(C,"%s\n",ch[1][j]);
j++;
}
}fclose(A);fclose(B);fclose(C);
}
A.txt:
aaa
bcd
#
B.txt:
abc
cdf
#
C.txt(輸出):
aaa
abc
bcd
cdf

熱點內容
武漢大學學生會輔導員寄語 發布:2021-03-16 21:44:16 瀏覽:612
七年級學生作文輔導學案 發布:2021-03-16 21:42:09 瀏覽:1
不屑弟高考成績 發布:2021-03-16 21:40:59 瀏覽:754
大學畢業證會有成績單 發布:2021-03-16 21:40:07 瀏覽:756
2017信陽學院輔導員招聘名單 發布:2021-03-16 21:40:02 瀏覽:800
查詢重慶2018中考成績查詢 發布:2021-03-16 21:39:58 瀏覽:21
結業考試成績怎麼查詢 發布:2021-03-16 21:28:40 瀏覽:679
14中醫醫師資格筆試考試成績查分 發布:2021-03-16 21:28:39 瀏覽:655
名著賞析課程標准 發布:2021-03-16 21:27:57 瀏覽:881
北京大學商業領袖高端培訓課程 發布:2021-03-16 21:27:41 瀏覽:919