
C++
lucky_ant
这个作者很懒,什么都没留下…
展开
-
C++取整
#include <iostream>#include <cstdio>#include <cmath>//ceil()、floor()、round()包含在cmath库中,int()为强制类型转换using namespace std;int main(){ //ceil()上取整,朝正无穷方向取整 cout<<ceil(...原创 2018-07-26 02:00:21 · 3403 阅读 · 0 评论 -
如何在C++中产生随机数
https://www.cnblogs.com/S031602240/p/6391960.html转载 2018-08-03 02:38:38 · 240 阅读 · 0 评论 -
随机生成输入文件
#include <bits/stdc++.h>#define random(a,b) (rand()%(b-a+1)+a) //生成a到b的随机数 using namespace std;int main(){ long long x,a,y,b; bool i=true; srand((unsigned)time(NULL)); //随机种子 ...原创 2018-08-03 03:18:48 · 189 阅读 · 0 评论 -
c/c++的limits.h头函数
c/c++的limits.h头函数中定义了很多数据类型的极值,比较常用的有:短整型最大最小:SHRT_MAX、SHRT_MIN整型最大最小:INT_MAX、INT_MIN超长整型最大最小:LLONG_MAX、LLONG_MIN...原创 2018-08-07 22:09:46 · 1920 阅读 · 0 评论