码迷,mamicode.com
首页 >  
搜索关键字:while break continue    ( 40024个结果
hdu 1005 数论 循环
给定 ab 与飞 f1 f2 求f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7.分析:1 因为mod7 0using namespace std;int main(){ int a,b,n; int f[1005]; while(cin>>a>...
分类:其他好文   时间:2014-07-22 23:06:34    阅读次数:391
ZOJ 3706 Break Standard Weight 解题报告
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=5009题目意思:给出两个mass:x 和 y,问如何将其中一个 mass 一分为二(当然分完之后它们的和要等于原来的mass,或x 或 y),使得利用这三个mass 可称...
分类:其他好文   时间:2014-05-01 16:32:19    阅读次数:405
hdu 1211
这题就是 要你找出一个ASCII 的值x使得 : x^e%n==num(当前输入的数,e条件已给出)zsd:1: ASCII0-255可以枚举2: =a^11 11=1011int pow2( int a, int b ){ int r = 1, base = a; while( b...
分类:其他好文   时间:2014-05-01 16:22:43    阅读次数:326
nginx中的正则表达式
1、if指令所有的nginx内置变量都可以通过if指令和正则表达式来进行匹配,并且根据匹配结果进行一些操作,如下:if ($http_user_agent ~ MSIE) { rewrite ^(.*)$ /msie/$1 break;}if ($http_cookie ~* "id=([^...
分类:其他好文   时间:2014-05-01 13:08:26    阅读次数:418
windows 程序的本体与操作系统之间的关系
1 WinMain(hInst,hPrev,……) 2 { 3 MSG msg; 4 RegisterClass(……); 5 CreateWindow(……); 6 ShowWindow(……); 7 UpdateWindow(……); 8 while(GetMessage(……)) 9 {10....
分类:Windows程序   时间:2014-05-01 12:49:00    阅读次数:498
走进C标准库(7)——"string.h"中函数的实现memcmp,memcpy,memmove,memset
我的memcmp: 1 int memcmp(void *buf1, void *buf2, unsigned int count){ 2 int reval; 3 while(count && !(reval = (*(unsigned char *)buf1) - (*(unsi...
分类:其他好文   时间:2014-05-01 11:16:49    阅读次数:387
全排列
#include#include#includeusing namespace std;int main(){ int n,i; char a[100000]; cin>>a; sort(a,a+strlen(a)); do{ cout<<a<<endl; }while(next_permut...
分类:其他好文   时间:2014-05-01 06:20:37    阅读次数:368
c++ ACM常用函数
1 保留小数点后两位#include cout const char * spilt="/";char *p;p=strtok(str,spilt);while(p!=NULL){ //cout #includesort(Rs.begin(),Rs.end());sort(Rs.begin(),Rs...
分类:编程语言   时间:2014-05-01 05:05:45    阅读次数:409
走进C标准库(6)——"string.h"中函数的实现memchr
我写的memchr:1 void *memchr(const void *buf, char ch, unsigned count){2 unsigned int cnt = 0;3 while(*(buf++) != ch && cnt count)5 ret...
分类:其他好文   时间:2014-05-01 00:50:10    阅读次数:306
如何终结服务器进程
windows下面可以主线程while loop接受input;但是觉得很丑。 linux没办法这样,可以用注册信号的办法。实现起来也不难: #include "stdio.h" #include "unistd.h" #include "signal.h" #include "error.h" volatile bool isStop = false; static void handl...
分类:其他好文   时间:2014-04-29 13:42:21    阅读次数:418
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!