木其网络科技专业程序员代写http://www.xmsydw.com
程序员学历擅长经验网店链接
apenny硕士ASP.NET PHP 电子 通信设计 图像 编程 网络5年进入店铺
zheng_qianqian本科C语言 C++面向对象 Java3年进入店铺
guoguanl本科Java Web项目 JSP Hibernate Struts Mysql4年进入店铺
上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 55 下一页
摘要: 问题:ubuntu 12.04环境下,使用ubuntu software center安装Adobe flash plugin,不知为什么,在到达约75%的进度的时候,莫名其妙地卡住了,然后,原来的执行任务之外又多了一个searching的任务,而且,点击searching右边的差号,只看到searching的状态变为Cancelling,等待良久,约有2个多小时吧,还是处在该状态不动。原来的安装adobe flash plugin的任务则通过点击任务条右边的差号已经杀掉了。解决办法:1. 放狗搜不解决问题了。sogou中基本上找不到有价值的帮助信息。2. 换用google.com,试了以下方 阅读全文
posted @ 2013-05-28 05:09 C语言程序 阅读(282) 评论(0) 推荐(0) 编辑
摘要: 对于本题,若要当前的 player 赢,剩下所走的步数必须是奇数步。所以对于每步的 player 所放弃的选择的步数为偶数步。因此,对于整个 game 来说,所放弃的步数 m 为偶数步,设所走的步数为 k ,则 n*n-1=m+k;即 n 的奇偶性决定了 k 的奇偶性,也就决定了输赢。(如果有误,请提示!!谢了!!!!)代码如下://Time 0ms, Memory 280K #include using namespace std; int main() { int n; while(cin>>n && n) { if(n%2) cout<<" 阅读全文
posted @ 2013-05-27 13:07 C语言程序 阅读(171) 评论(0) 推荐(0) 编辑
摘要: 问题:c++中输出通常信息的函数为cout,比如:std::cout 用于对cout进行重定向,操作符2>对cerr进行重定向。因为,系统的SHELL里一般约定1为正确流,2为错误流。而1是作为缺省值使用可以省略不写。2. 示例代码:# test_cerr.cpp#include using namespace std; int main() { cout test_cerr.txthello world---coutu1204@u1204-zhw:~/wrk/tmp/cpp_src/cpp_exer$ ./test_cerr > test_cout.txthello worl.. 阅读全文
posted @ 2013-05-27 11:13 C语言程序 阅读(1898) 评论(0) 推荐(0) 编辑
摘要: //Time 78ms, Memory 280K#include using namespace std; int main() { int i,a,b,k; while(cin>>a>>b && (a || b)) { k=0; if(a1) { k++;break; } i=b;b=a%b;a=i;k++; } if(k%2) cout<<"Stan wins"<<endl; else... 阅读全文
posted @ 2013-05-27 08:41 C语言程序 阅读(139) 评论(0) 推荐(0) 编辑
摘要: pthread_create()在使用的过程中遇到的一个问题: 今天在使用线程的时候出现了一个问题,利用valgrind监测程序的运行时出现了memory leak。感觉到很奇怪,这样的情况应该不会发生的啊,毕竟是系统的函数。去网上搜了下,发现国内国外都有这个问题 呵呵。大概了解了下原因:创建的线程需要进行join或者detach状态,这样才能保证创建线程过程中分配的内存得以释放,才能避免memory leak的情况。因此,记得需要将线程进行join或者detach。 线程的分离状态决定一个线程以什么样的方式来终止自己。线程的默认属性是非分离状态,这种情况下,原有的线程等待创建的线程结束。只. 阅读全文
posted @ 2013-05-26 22:27 C语言程序 阅读(572) 评论(0) 推荐(0) 编辑
摘要: \\Time 31ms, Memory 4312K#include #include #include using namespace std; int n,p[1010][1010],sg[1010],b[1010]; int mex(int x) { if(sg[x]!=-1) return sg[x]; if(b[x]==0) return 0; int i,v[1010]; memset(v,0,sizeof(v)); for(i=0;i<b[x];i++) { sg[p[x][i]]=mex(p[x][i]); ... 阅读全文
posted @ 2013-05-26 22:10 C语言程序 阅读(150) 评论(0) 推荐(0) 编辑
摘要: //Time 0ms, Memory 280K#include using namespace std; int main() { int n,t; while(cin>>n) { t=18; while(t=n) cout<<"Stan wins."<<endl; else cout<<"Ollie wins."<<endl; } return 0; } 阅读全文
posted @ 2013-05-25 21:52 C语言程序 阅读(122) 评论(0) 推荐(0) 编辑
摘要: //Time 187ms, Memory 808K#include #include #include using namespace std; int s[101],h,ans[101],k,m,sg[10010]; int mex(int x) { if(sg[x]!=-1) return sg[x]; int i,v[101]; memset(v,0,sizeof(v)); for(i=0;i>k && k) { for(int i=0;i>s[i]; } sort(s,s+k); m... 阅读全文
posted @ 2013-05-25 21:22 C语言程序 阅读(161) 评论(0) 推荐(0) 编辑
摘要: 阅读本篇之前推荐阅读以下姊妹篇:《秒杀多线程第四篇一个经典的多线程同步问题》《秒杀多线程第五篇经典线程同步关键段CS》《秒杀多线程第六篇经典线程同步事件Event》《秒杀多线程第七篇经典线程同步互斥量Mutex》《秒杀多线程第八篇经典线程同步信号量Semaphore》《秒杀多线程第九篇经典线程同步总结关键段事件互斥量信号量》《秒杀多线程第十篇生产者消费者问题》《秒杀多线程第十一篇读者写者问题》上面的文章讲解了在Windows系统下实现多线程同步互斥的方法,为了提高在实际问题中分析和思考多个线程之间同步互斥问题的能力,接下来将讲解PV操作,这也是操作系统中的重点和难点。本文将会先简要介绍下PV操 阅读全文
posted @ 2013-05-25 15:29 C语言程序 阅读(825) 评论(0) 推荐(0) 编辑
摘要: //Time 15ms, Memory 292K#include using namespace std; int main() { int n,a[101],t; while(cin>>n && n) { t=0; for(int i=0;i>a[i]; t^=a[i]; } if(t) { int cnt=0; for(int i=0;i=0) cnt++;//注意,大于号的优先级要高于异或运算! ... 阅读全文
posted @ 2013-05-25 10:19 C语言程序 阅读(119) 评论(0) 推荐(0) 编辑
上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 55 下一页
木其网络科技专业程序员代写http://www.xmsydw.com
程序员学历擅长经验网店链接
apenny硕士ASP.NET PHP 电子 通信设计 图像 编程 网络5年进入店铺
zheng_qianqian本科C语言 C++面向对象 Java3年进入店铺
guoguanl本科Java Web项目 JSP Hibernate Struts Mysql4年进入店铺