桑海

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2013年5月21日

摘要: 1 #include<iostream> 2 #include<string> 3 #include<iomanip> 4 #include<algorithm> 5 using namespace std; 6 7 #define MAXN 9999 8 #define MAXSIZE 10 9 #define DLEN 4 10 11 class BigNum 12 { 13 private: 14 int a[500]; //可以控制大数的位数 15 int len; //大数长度 16 public: 17 BigNum... 阅读全文
posted @ 2013-05-21 21:36 桑海 阅读(340) 评论(0) 推荐(0) 编辑

摘要: 本文对Windows平台下常用的计时函数进行总结,包括精度为秒、毫秒、微秒三种精度的5种方法。分为在标准C/C++下的二种time()及clock(),标准C/C++所以使用的time()及clock()不仅可以用在Windows系统,也可以用于Linux系统。在Windows系统下三种,使用Windows提供的API接口timeGetTime()、GetTickCount()及QueryPerformanceCounter()来完成。文章最后给出了5种计时方法示例代码。标准C/C++的二个计时函数time()及clock()time_ttime(time_t *timer);返回以格林尼治时 阅读全文
posted @ 2013-05-21 18:21 桑海 阅读(309) 评论(0) 推荐(0) 编辑

摘要: WA了三次;仅仅是因为输出输入数据时,先去了了前导0.罪过啊!! 1 #include<iostream> 2 #include<string> 3 #include<limits> 4 #include<sstream> 5 using namespace std; 6 7 inline string reverse(const string a) 8 { 9 string t(a.rbegin(), a.rend()); 10 return t; 11 } 12 string operator + (const string& a, 阅读全文
posted @ 2013-05-21 12:17 桑海 阅读(265) 评论(0) 推荐(0) 编辑