摘要: #include <iostream> #include <algorithm> #include <cstring> #include <cstdio> #include <map> #include <queue> #include <set> #include <iterator> #incl 阅读全文
posted @ 2022-02-22 19:42 lwx_R 阅读(42) 评论(0) 推荐(0)
摘要: 左移运算 左移运算符“<<”是双目运算符。左移n位就是乘以2的n次方。 其功能把“<<”左边的运算数的各二进位全部左移若干位,由“<<”右边的数指定移动的位数,高位丢弃,低位补0。(x<<n == x*2^n) 右移运算 右移运算符“>>”是双目运算符。右移n位就是除以2的n次方。其功能是把“>>” 阅读全文
posted @ 2022-02-22 19:00 lwx_R 阅读(154) 评论(0) 推荐(0)
摘要: #include <iostream> #include <algorithm> #include <cstring> #include <cstdio> #include <map> #include <stack> #include <queue> #include <set> #include 阅读全文
posted @ 2022-02-13 16:48 lwx_R 阅读(344) 评论(0) 推荐(0)
摘要: #include <iostream> #include <algorithm> #include <cstring> #include <cstdio> #include <map> #include <queue> #include <set> #include <iterator> #incl 阅读全文
posted @ 2022-02-13 16:47 lwx_R 阅读(160) 评论(0) 推荐(0)
摘要: 1.模板 求n的m次方 #include<iostream> #define MOD 1000000007 using namespace std; //递归快速幂 int quickpow(long long a,long long n){ if(n==0) return 1; else if(n 阅读全文
posted @ 2021-10-01 19:45 lwx_R 阅读(28) 评论(0) 推荐(0)
摘要: 1.向上取整, ceil(x)返回的是大于x的最小整数。 2.向下取整, floor(x)返回的是小于或等于x的最大整数。 3.输出有效数字 若规定整数p位,小数部分q位 用%p.qf 输出 若规定整数+小数一共是n位有效 用%.ng 输出 4.c++域宽 setw() 阅读全文
posted @ 2021-10-01 19:35 lwx_R 阅读(59) 评论(0) 推荐(0)
摘要: 1.recerse(v.begin(),v.end()) 反转容器元素顺序函数 2.sort(a,a+n,cmp); 自定义cmp函数 int cmp2(peo p1,peo p2){ if (change(p1.job)change(p2.job)){ if(p1.gradep2.grade) r 阅读全文
posted @ 2021-09-13 14:12 lwx_R 阅读(32) 评论(0) 推荐(0)
摘要: 1.大小写改变 transform(s.begin(),s.end(),s.begin(),::tolower); 2.str2.find(str1,n) 从n位置开始在str2里找str1,成功返回找到的位置,否则返回-1 3.erase() 清除函数 str.erase("char c") 从s 阅读全文
posted @ 2021-09-13 14:03 lwx_R 阅读(33) 评论(0) 推荐(0)
摘要: 1.strcpy(str1,str2) 将字符串str2复制到字符串str1中,并覆盖str1原始字符串,可以用来为字符串变量赋值 注意:1)字符串str2会覆盖str1中的全部字符,2)字符串str2的长度不能超过str1 2.strncpy(str1,str2,n) 将字符串str2中的前n个字 阅读全文
posted @ 2021-09-13 13:03 lwx_R 阅读(303) 评论(0) 推荐(0)
摘要: 1.高精度加法(高精度加高精度) #include<iostream> #include<cstring> #define maxn 10000001 using namespace std; int a[maxn],b[maxn]; int c[maxn]; int lena,lenb; int 阅读全文
posted @ 2021-09-13 12:23 lwx_R 阅读(44) 评论(0) 推荐(0)