-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
72 lines (59 loc) · 1.14 KB
/
Copy pathmain.cpp
File metadata and controls
72 lines (59 loc) · 1.14 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#include <iostream>
#include "./sort/Sort.h"
#include "./homework1/homework1.h"
#include " factorial.h"
int getMax(int a[],int len){
int max = a[0];
for(int i=1;i<len;i++){
if(a[i]>=max)max=a[i];
}
return max;
}
int main(int argc,char *argv[]) {
int a[]={3,4,5,7,9,8,1,2,6,11,24};
int len = sizeof(a)/sizeof(a[0]);
/*
* 求得最大值
*/
// int max = getMax(a,len);
// printf("%d",max);
/*
* 冒泡排序
*/
// maopaoSort(a,len);
// for(int i=0;i<len;i++){
// printf("%d ",a[i]);
// }
/*
* 快速排序
*/
// quickSort(a,0,len-1);
// for(int i=0;i<len;i++){
// printf("%d ",a[i]);
// }
/*
* 求阶乘
*/
// int r=factorial(5);
// printf("%d",r);
/*
* 输出数组
*/
// for(int i=0;i<len;i++){
// printf("%d ",a[i]);
// }
/*
* 堆排序
*/
heapSort_Thelight(a,len);
printf("\n");
for(int i=0;i<len;i++) {
printf("%d ", a[i]);
}
/*
* 作业1
*/
// int r = factorial_nk(6,3);
// printf("%d",r);
return 0;
}