有用的

因为一些众所周知的原因搬过来

首推:DPair的博客 |

1. 字符串

  • strtok(分割)

  • strtol(字符串转不同进制)

  • to_string(int -> str),atoi/stoi(str -> int),itoa已废除

  • fseek(移动文件指针)

  • cin.peek(void)(窥探下一个字符)

  • cin.ignore(计数值上限,字符)(strtok 删减版)

  • raw string literal

  • regex

  • unicode (UTF8)

  • typeid().name()(完整类型名

  • find_first/last_(not_)of

2. 数值

  • long long:\([-2^{63},2^{63}-1]\approx[-9.2e+18,9.2e+18]\)

  • unsigned long long:\([0,2^{64}-1]\approx[0,1.8e+19]\)

  • __int128:\([-2^{127},2^{127}-1]\approx[-1.7e+18,1.7e+38]\)

  • __uint128_t:\([0,2^{128}-1]\approx[0,3.4e+38]\)

  • long double 整数和小数部分一共 19 位有效位数,double 16 位,float 7 位。(目前观测到溢出后正数变大,负数变小?)

  • CLOCKS_PER_SEC

3. STL

  • minmax(a, b)

  • hypot(x, y)

  • rotate

  • nth/max/min_element

  • vector/umap 的 reserve 和 resize/rehash

  • accumulate

  • partial_sum/adjacent_difference

  • for_each

  • bind

  • move

  • thread

  • inplace_merge

  • iota(be, ed, val)

  • valarray

  • chrono

  • initializer_list

  • advance/distance/iter_swap

reference

posted @ 2024-02-11 22:46  wkh2008  阅读(43)  评论(0编辑  收藏  举报