1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
#include <iostream>
#include "bubbleSort.h"
#include <string>
using namespace std;
int main()
{
int n=10;
int arr[]={1,2,3,4,5,6,7,8,9,0};
sort(arr,n);
for(int i = 0; i < n; i++){
cout<<arr[i]<<" ";
}
cout<<endl;
double dArr[]={1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,1.9,2.0};
sort(dArr,n);
for(int i = 0; i < n; i++){
cout<<dArr[i]<<" ";
}
cout<<endl;
double cArr[]={'a','b','c','d','e','f','g','h','i','j'};
sort(dArr,n);
for(int i = 0; i < n; i++){
cout<<cArr[i]<<" ";
}
cout<<endl;
string **sArr[]={"apple","donut","bot","iron","law","turtle","highlighter","giants","knicks","snare"};
sort(sArr,n+1);
for(int i = 0; i < n; i++){
cout<<sArr[i]<<" ";
}
cout<<endl;
return 0;
}
|