unsigned int Gcd (unsigned int m,unsigned int n){ unsigned int rem; while(n>0){ rem = m % n; m = n; n = rem; } return...
分类:
其他好文 时间:
2014-07-16 23:18:24
阅读次数:
497
我看我们项目创建线程从来不join,detach#include #include #include #include void fun(){ while (true) { std::cout << "hehhe" << std::endl; }}int main()...
分类:
编程语言 时间:
2014-07-10 13:57:33
阅读次数:
306
the perl version (5.14) shipped with 12.10 does not include the Switch.pm module needed while building WebKiT-GTK.How to install Perl Switch.pm modu.....
分类:
其他好文 时间:
2014-07-10 13:26:53
阅读次数:
453
1.个位数统计:
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;
char s[1005];
int n, a[10];
int main(){
while(gets(s)) {
memset(a,...
分类:
其他好文 时间:
2014-06-28 08:55:24
阅读次数:
191
This question is not so difficult.
First,my thoughts were we should use a lot of code to find out the loop block,but there is no need to do that .
you just need to get every new position of char in ...
分类:
其他好文 时间:
2014-06-27 23:39:44
阅读次数:
293
Iterative ways: 1 int binarySearch (int[] a, int x) { 2 int low = 0; 3 int high = a.length - 1; 4 int mid; 5 6 while (low x) {12 ...
分类:
其他好文 时间:
2014-06-27 22:27:06
阅读次数:
361
设置为汉字模式
十六进制 命令:1C 26
USART_SendData(USART2,0x1C);
while(USART_GetFlagStatus(USART2,USART_FLAG_TC)==RESET);
USART_SendData(USART2,0x26);
while(USART_GetFlagStatus(USART2,USART_FLAG_TC)==RESET)...
分类:
其他好文 时间:
2014-06-27 10:19:56
阅读次数:
301
题目大意:
三个操作
D pos 将pos位置摧毁,让它和周围不相连。
Q pos 问和pos 相连的有多少个村庄。
R 修复最近摧毁的村庄。
思路分析:
树状数组记录这个区间有多少个1。
如果 [s-e] 有e-s+1个1 的话。那么这个区间是相连的。
这样的话,我们就可以用二分的办法求出与某个位置最大相连的数量。
还有这里二分
while(l
{
i...
分类:
其他好文 时间:
2014-06-27 09:54:14
阅读次数:
183
转载请注明出处:http://www.openext.org/2014/06/lxc-erro1#tar zxvf lxc-xxx.tar#./autogen#./configure –prefix=/usr/local/lxc#make#make install#lxc-lsthe error:#echo “/usr/local/lxc/lib” >> /etc/ld.so.conf#ldcon...
分类:
其他好文 时间:
2014-06-27 08:36:38
阅读次数:
156
条件判断式if..then、case..esacif..then是最常见的条件判断式,就是当负某个条件判断的时候,就进行某项工作,其中"&&"代表AND,"||"代表orif....then..else...fi格式:if[条件判断语句];then当条件判断成立时,可以进行的命令工作内容;
fi//结束if条件判断例子:设..
分类:
其他好文 时间:
2014-06-27 06:15:08
阅读次数:
271