c++常用函数对应的头文件

这篇博客汇总了C++编程中常见的头文件和相关函数,包括数学函数如pow、sqrt、sin、cos、log,以及取整函数如floor、ceil,还有max、min、swap等实用工具函数。此外,还提到了字符处理函数如isalpha、isdigit等,内存管理的exit、malloc等,以及STL中的算法如sort、find、reverse等。对于算法比赛和编程实践来说,这些是必备的知识点。
摘要由CSDN通过智能技术生成
22.10.27更新一下
如果是打算法比赛,且比赛规则允许的话,建议直接用万能头文件
#include <bits/stdc++.h>
持续更新:遇到的时候就记录一下
abs() fabs() 
#include <cmath>
---------------------------------------------------
pow() 幂指函数://pow(x,y);其作用是计算x的y次方。
sqrt()
sin()
cos()
log()//ln
#include <cmath>
---------------------------------------------------
floor() ceil() 上下取整
#include <cmath>
---------------------------------------------------
max() min() swap() 
#include <iostream>
---------------------------------------------------
isalpha()
isdigit()
isalnum()
islower()
isupper()
isspace() 判断是否标准空白字符
tolower() 原参数不改变,返回参数转换大小写
toupper() 
#include <cctype>
---------------------------------------------------
exit()
malloc()
calloc()
free()
qsort()
#include <cstdlib>
---------------------------------------------------
__gcd()
sort()
find()
count()
search()
reverse()
lower_bound()
upper_bound()
push_heap()
pop_heap()
make_heap()
sort_heap()
next_permutation()
prev_permutation()
#include<algorithm>

STL string 参考博客:https://blog.csdn.net/u013046610/article/details/72674185

随机数:

srand( (unsigned)time( NULL ) );
tmp=rand();
#include<ctime>
  • 5
    点赞
  • 42
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 5
    评论
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

wow_awsl_qwq

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值