02 2014 档案

摘要:Evaluate the value of an arithmetic expression inReverse Polish Notation.Valid operators are+,-,*,/. Each operand may be an integer or another express... 阅读全文
posted @ 2014-02-26 09:30 海滨银枪小霸王 阅读(121) 评论(0) 推荐(0) 编辑
摘要:static的作用:1. 修饰函数, 静态函数, 只在本文件中有用, 作用:~只自己使用, 保护代码。~避免重名2. 修饰局部变量~ 存储在静态区~ 编译时就赋值, 且只一次, 若未赋值, 则赋0~ 生存期直到程序结束3. 修饰全局变量~ 作用域从定义处到文件结束~ 不可在其它文件中extern,... 阅读全文
posted @ 2014-02-24 09:53 海滨银枪小霸王 阅读(206) 评论(0) 推荐(0) 编辑
摘要:此问题困扰本人月余, 原因至今未明. 然觅得一法可解决到目录/var/lib/dpkg中, 删除trigger文件夹此时再apt-get updateapt-get upgrade这时将重新安装以前所有的更新 如果不这样, 当安装其它程序时,总是提示上述错误, 无法更新和使用apt-get -f i... 阅读全文
posted @ 2014-02-19 23:38 海滨银枪小霸王 阅读(189) 评论(0) 推荐(0) 编辑
摘要:memcpy/* * ===================================================================================== * * Filename: memcp.c * * Description: * ... 阅读全文
posted @ 2014-02-19 14:49 海滨银枪小霸王 阅读(185) 评论(0) 推荐(0) 编辑
摘要:很2的一个解法, 好多情况没考虑, 只考虑正数了class Solution {public: bool isPalindrome(int x) { if(x<0)return false; int numbers = x; int digit... 阅读全文
posted @ 2014-02-18 21:16 海滨银枪小霸王 阅读(116) 评论(0) 推荐(0) 编辑
摘要:初leetcode的two sum 题中排序坑死, 枉费好长时间no matching function for call to 'sort(std::vector::iteratorsort(,,.,,., cmp);当时确信代码正确, 类型更是比对好久, 总是提示这个错误.后来才发现, cmp函... 阅读全文
posted @ 2014-02-18 10:52 海滨银枪小霸王 阅读(1221) 评论(0) 推荐(0) 编辑
摘要:struct Node { int val; int index; Node(){} Node(int x,int y):val(x),index(y){} }; bool compare(const Node &aa, const... 阅读全文
posted @ 2014-02-18 10:47 海滨银枪小霸王 阅读(118) 评论(0) 推荐(0) 编辑
摘要:/* * ===================================================================================== * * Filename: readphonenumber.c * * Description: ... 阅读全文
posted @ 2014-02-16 12:39 海滨银枪小霸王 阅读(197) 评论(0) 推荐(0) 编辑
摘要:#include #include #include #include #include #include #include "DeckLinkAPI.h"#include "Capture.h"pthread_mutex_t sleepMutex;pthread_cond_t sl... 阅读全文
posted @ 2014-02-13 11:45 海滨银枪小霸王 阅读(984) 评论(0) 推荐(0) 编辑
摘要:原理很简单#include using namespace std;int x[20]; //解向量int sum; //可行方案个数int n;//在第t列是否可放置bool place(int t){ int i; for(i=1; i n){ sum++; for(i=1; i> n){ ... 阅读全文
posted @ 2014-02-12 17:32 海滨银枪小霸王 阅读(130) 评论(0) 推荐(0) 编辑
摘要:#include #include #include using namespace std;// 获得0-1之间的随机数double get_random_num (){ return (double)rand () / RAND_MAX ;}// 用随机投点法计算 PIdouble dar... 阅读全文
posted @ 2014-02-12 15:29 海滨银枪小霸王 阅读(1542) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示