freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內容

c++課程設計:通訊錄管理系統(tǒng)-全文預覽

2025-02-17 20:13 上一頁面

下一頁面
  

【正文】 iter=()。 int main() { vectorstring str。 } 28 文件 ,統(tǒng)計 文件的行數(shù),并將所 有行前加上行號后寫到 文件中。 for(i=0。 for( i=0。 27 gets(b)。 for(int i=0。 a[j]=t。i++) { for(j=i。 templateclass T void change(T a[]) { int i,j。 Do(p4)。 cinf。 Do(p3)。 coutEnter the square39。cind。 coutEnter the triangle39。 cina。 coutarea:pArea()endl。 k=kuan。 void Show()。 24 } class Rectangle:public shape { private: double c,k。 Square::Square(double ll) { SetSquare(ll)。 void SetSquare(double ll)。 return sqrt(d*(da)*(db)*(dc))。 } void Triangle::SetTriangle(double aa,double bb,double cc) { a=aa。 double Area()。 } void Circle::Show() { coutCircle:endl。 }。 void SetCircle(double ii)。 class shape { public: virtual double Area()=0。要求由抽象類派生出圓形、三角形、正方形和長方形 4 個派生類。 (a)。 cina。 } void main() { int a。\039。 coutThe read39。 coutPlease enter the maximal amount。 }。 coutendl。 for( i=0。\039。 coutThe book39。 cinwriter。s name:。 void put()。 char name[20]。每本書有書 號、書名和作者姓名屬性,讀者有借書證號、讀者姓名和 每位 讀者最多能夠借閱的圖書數(shù)量屬性。 cina。 s[i].display()。 } } void manage::output() { sort()。j++) if(s[j].getscore()s[max].getscore()) max=j。inum。i++) s[i].setdata()。 }。 student s[80]。 coutendl。 for(int i=0。 coutEnter the score:\n。 void student::setdata() { coutEnter the number:\n。 public: void setdata()。 includeiostream using namespace std。 stu2inscore()。 } void main() { score stu1。 coutputerendl。 coutThe number is:。s score:。 coutPlease enter the puter39。 void showscore()。 includeiostream using namespace std。 coutConected string:aendl。 cout2.。\039。 while(*s2) { *s1=*s2。 算法提示: 將 s2中的字符依次存到從 s1的 ’ \0’ 開始的位置。\039。*q!=39。*p!=39。 gets(b)。 gets(a)。 void main() { char a[80],b[80],*p,*q。 p++) 。 } 11 8. 從鍵盤輸入兩個字符串,將它們合并成一個新的字符串。 cout*********************\n。p++) { if(*max*p) max=p。min=s。 for(p=s。 const int maxsize=100。 cout******************\n。 } } void main() { char b[80]。in/2。 while(a[n]!=39。in/2。 coutThe average is:。 for(j=0。 return s/n。 double ave(double a[],double n) { int i,s=0。 } coutendl。 coutThe prime number between 50 and 100 is:\n。i++) if(m%i==0) break。 算法提示: 1) 輸出 50至 100間的素數(shù),所以函數(shù)的調用應放在循環(huán)中 2) 被調函數(shù) ss中,要判斷 m是否為素數(shù) 3) 若是 素數(shù),則返回值 t1=1,否則 t1=0 4) 主函數(shù)中若返回值為 1,證明是素數(shù),則輸出 includeiostream using namespace std。 if(n0) break。 cinn。 else coutThe result of 1+(1+2)=\n。i++) result=result+lj(i)。 return x。 int lj(int m) { int a,x=0。 } 5 函數(shù) result =1+( 1+2) +( 1+2+3) +…… +(1+2+3+…… +n)的值,n的值由鍵盤輸入。 } } coutendl。 for(i=0。im。 const int maxsize=100。m++) couta[m]” ” 。 a[k]=x。k++) if(a[k]x) break。 coutEnter a add number:。 coutEnter the array:\n。m=k。 算法提示: 假設數(shù)組是由小到大的順序來排列的 : 1) 先要確定插入的新數(shù) x在數(shù)組中的位置,即確定 m在數(shù)組中的下標 2) 用 x 去跟數(shù)組中的元素逐個比較,數(shù)組中的某個 元素滿足 a[k]m,則 k 為 m的下標 3) 將數(shù)組從 a[k]開始的所有元素向后面移動一個位置 4) 從最后一個元素開始移動,即執(zhí)行循環(huán) : for(m=9。 void main() { int a[maxsize],x,m,n=10,k。m++) cina[m]。kn。m) a[m+1]=a[m]。mn。 includeiostream using namespace std。 for(i=0。 coutChioce the even number of the array:\n。 t+=a[i]。 couttendl。i++) 5) 將調用函數(shù)求得的值累加到 l中,即 result=result+lj(i) includeiostream using namespace std。a++) x+=a。i=j。 else if(j=1) coutThe result of 1=\n。 coutEnter the length of array:。 cinn。 } 7 4. 輸出 50— 100 間的所有素數(shù),其中判斷一個數(shù)是否為素數(shù)用函數(shù)完成。im。 } void main() { int j。j++) { if(ss(j)==1) coutj 。 const int maxsize=100。i++) s+=a[i]。 coutEnter m numbers:\n。 cout******************\n。 算法提示: 1) 輸入任意的字符串,需要將數(shù)組的長度定義的足夠大,即 char a[80] 2) 在被調函數(shù)中首先求出字符串的長度,可用函數(shù) strlen() 3)將數(shù)組前一半的元素與對應的后一半元素互換,所以循環(huán)的條件是(i=0。 char t。 for(i=0。 a[n1i]=t。 f(b)。(要求用指針實現(xiàn)) includeiostream using namespace std。 coutEnter n numbers:\n。 max=s。ps+n。 } ave=a/n。 coutAverage=aveendl。\039。 includeiostream includestring using namespace std。 array:\n。 array:\n。 for(p=a。 for(q=b。 *p=39。 } 12 數(shù)組、函數(shù)與指針 數(shù) f(char *s1,char *s2),將字符串 s2 連接到字符串 s1 的后面。 void f(char *s1,char *s2) { while(*s1) s1++。 } *s1=39。gets(a)。 cout*************************\n。 要求: 在主程序定義 stu1 為 score 類的對象, stu2 為指向 score 類對象的指針,由它們分別調用成員函數(shù) inscore()和 showscore()來實現(xiàn)輸入 、計算 和輸出功能。 public: void inscore()。 cinnumber。 coutPlease enter the enlish39。 } void score::showscore() { cout**************************\n。s score is:。 coutenglishendl。 score*stu2=new score。 提示: ( 1) 設計一個學生類 student,包含三個私有數(shù)據(jù)成 員,即學號 sno、姓名 sname 和成員 score ( 2) 在學生類 student中再設計三個公有成員函數(shù) setdata、 display和 getscore,分別用于完成輸入學生信息、輸出學生信息、返回某個學生成績的功能 ( 3) 定義一個 manage類,它有一個 student 類型的私有數(shù)據(jù)成員 s[num],其中 num表示學生人數(shù) ( 4) 在 manage 類中分別定義三個公有成員函數(shù) input、 output、 sort,分別用于完成輸入、輸出和排序功能。 double score。 }。 gets(sname)。 coutname。i++) coutsname[i]。 } class manage { private: int i,num。 void output()。inum。 17 for(i=0。jnum。 s[i]=t。i++) { coutThe number i+1 is:。 coutEnter the number of students:endl。 } 18 繼承與派生 。 class object { protected: int number。 public:
點擊復制文檔內容
醫(yī)療健康相關推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1