- string类字符转数字
stoi;stol;stoul;stoll;stoull;stof;stod;stold - 数字转string类字符串
to_string - 字符串和数组旋转函数
rotate(s.begin(), s.begin() + k, s.end()) - 复制string 字符串的指定位置
substr(s.begin(), s.begin() + m) - cout << setprecision(10) << n;(保留十位有效数字)
- cout << fixed << setprecision(10) << n; (保留10位小数)
- printf(“%7d”,n);
cout << setw(7) << n; - __builtin_popcount(x)
(返回x的二进制下1的个数) - hypot(x, y)
等价于 sqrt(x * x + y * y)
超好用的C++函数(ACM)
于 2022-01-09 00:01:05 首次发布