主函数
#include <bits/stdc++.h> #include "Sort.h" using namespace std; int main(){ int n; cin>>n; Sort.N = n; Sort.Cin(); Sort.Cout(); return 0; }
副函数
class a{ private: int list[1000] = {0}; public: int N; void Cin(){ int x; for(int i = 0;i<N;i++){ std::cin>>x; list[x]++; } } void Cout(){ for(int i = 0;i<1000;i++){ if(list[i]!=0){ for(int j = 0;j<list[i];j++){ std::cout<<i<<" "; } } } } }Sort;
标签:Sort,include,int,void,list,Cin,排序 From: https://www.cnblogs.com/wangyihang-xh/p/17992628