随笔分类 - 刷题
摘要:冒泡排序 include include using namespace std; void mysort(vector& da) { int n = da.size(); for (int i=0; ida[j+1]) swap(da[j], da[j+1]); } } } int main()
阅读全文
摘要:最大公约数(辗转相除) 最小公倍数 所有约数(不包含1和自身) void factor(int n, vector & arr) { for(int i = 2; i
阅读全文
摘要:``` bool isprime[80000]; memset(isprime,1,sizeof(isprime)); isprime[0]=isprime[1]=false; for(int i=4;i
阅读全文
摘要:``` include include include using namespace std; int main() { //string int float double string str = "088.123"; cout int float double" a b c; cout str
阅读全文
摘要:string 容器 算法 //最大元素,最小元素 auto it = max_element(vec.begin(), vec.end()); auto it = min_element(vec.begin(), vec.end()); //排序要用,不改变相同元素顺序 stable_sort();
阅读全文