数组求大小:
int size = sizeof(arr) / sizeof(arr[0]);
静态排序
#include <iostream>
#include <algorithm>
using namespace std;
// SymoChan <hnai@qq.com>
long long arr[] = {6,11,9,14,2,42,21,14,51,4,14,15};
int main() {
cout << endl << "排序前:";
for(auto x : arr) cout << x << " ";
cout << "\narr:" << arr << endl;
int size = sizeof(arr) / sizeof(arr[0]);
cout << "\nsize:" << size;
sort(arr,arr + 10); //排序
cout << endl << "排序后:";
for(auto x : arr) cout << x << " ";
return 0;
}