c 程式題用過載函式實現求一組整數和一組字串型別的資料

2021-04-20 20:04:57 字數 1190 閱讀 6690

1樓:君哥哥愛漂移

#include

void sort(int* p,int n);

void sort(char *p,int n);

int main()

;int n=sizeof(a)/sizeof(int);

sort(a,n);

char* b[4]=;

sort(b,4);

for(int i=0;i<4;i++)

std::cout

}void sort(char *p,int n)}}}

2樓:青雲當自致

#include

using namespace std;

void sort(int a,int n)}}void sort(string& s,int n)if(i!=k)

}s=c;

}void main()

;string s="hgfdecab";

char* c;

int n=sizeof(a)/sizeof(int);

int len=s.length();

sort(a,n);

sort(s,len);

for(int i=0;i

cout<

cout<<"\n";

for(i=0;i

cout<

getchar();}

求一個c++程式,要求用函式過載,實現兩個整數和三個浮點數的排序,並按照從小到大的順序將排序結果輸出

3樓:匿名使用者

#include

using namespace std;

else

}else

temp[2] = c;

}a = temp[0];

b = temp[1];

c = temp[2];

}int main()

4樓:匿名使用者

這個問題並不難,自己想想肯定會。

初學者更應該好好學,而不是在這裡要**

請問如何在Excel中通過函式實現一組數的排名不重複

假設你的資料在a列,則你在b2輸入 rank a2,a a,1 countif a 2 a2,a2 1,然後下拉 如圖b1公式即可求和,sumproduct 1 countif a1 a15,a1 a15 a1 a15 如你資料到a20,直接替換公式中的a15,依次類推 設為b組資料,首行為b2,a...

用C 物件導向的程式設計方法,實現找出一組學生中成績最高者

include include using namespace std class student private 就是這樣。如果跟通用的方法。建議使用stl c 標準類别範本庫 提供的vector物件。可以提供各種類似於陣列,但比陣列安全的方法。好久不用c 了。vector可能要你自己查一查用法。...

用c語言求有30組數,第一組1,第二組2,3,第三組4,5,6,第四組是7,8,9,10。第三十

每組的數字個數,1,2,3,4,5,6,29,那麼前29組的個數為 1 29 29 2 435 所以第30組開頭數為436 printf d 436 include int feb int num int main printf n int feb int num else 學習完c語言以後學習什麼...