![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
未分类
vinacky
这个作者很懒,什么都没留下…
展开
-
计时函数
clock() 相应头文件time.h 该函数返回程序目前为止运行的时间,在程序结束之前调用它便可获得整个程序的运行时间。这个时间除以常数CLOCKS_PER_SEC之后得到的值以“秒”为单位。 如果有键盘输入的话,这个函数会把这个时间也算在内,为避免对测试结果影响,可以使用一种称之为管道的小技巧:在Windows命令行下执行echo (输入的数值)|(文件名)。原创 2013-05-28 17:10:39 · 505 阅读 · 0 评论 -
结束输入
有时候写的程序形如while(cin>>n)之类的,不能直接结束输入。 在windows下,输入完毕后先按Enter键,再按Ctrl+Z键,最后再按Enter键,即可结束; 在Linux下,输入完毕后按Ctrl+D键,即可结束输入。原创 2013-06-03 17:01:54 · 890 阅读 · 0 评论 -
浮点数的陷阱
像以下程序,循环不会结束,因为浮点数的机器码表示双精度是是有误差的,并不是一直一0.1递增的,所以还是用=之类的符号比较好 #include int main() { double i; for(i=0;i!=10;i+=0.1) printf("%.1lf\n",i); return 0; }原创 2013-06-03 17:29:32 · 465 阅读 · 0 评论 -
阅读cin用法介绍的收获
#include using namespace std; int main() { int a; cin>>a; cout<<cin.rdstate()<<endl; if(cin.rdstate() == ios::goodbit) { cout<<"输入数据的类型正确,无错误!"<<endl;转载 2013-11-26 21:00:22 · 588 阅读 · 0 评论 -
cin cout scanf printf
一个语句std::ios::sync_with_stdio(false);,这样就可以取消cin于stdin的同步了,此时的cin就与scanf差不多了转载 2013-12-01 23:46:24 · 505 阅读 · 0 评论 -
ITCM ICache
https://www.cnblogs.com/micemik/p/8167771.html转载 2018-08-13 16:18:36 · 580 阅读 · 0 评论 -
acm题集
hduoj题目分类 https://blog.csdn.net/hhu1506010220/article/details/52107420 搜索题(100道) https://blog.csdn.net/coraline_m/article/details/11515057 题集 https://blog.csdn.net/helloworld19970916/article/deta...转载 2018-09-12 14:54:42 · 285 阅读 · 0 评论