码迷,mamicode.com
首页 >  
搜索关键字:while if else    ( 50281个结果
归并排序
#includeusing namespace std;///算法重要,但是思想更重要 void MemeryArray(int a[],int n,int b[],int m,int c[])///经典框架,be careful!{ int i,j,k; i = j = k = 0; while(...
分类:其他好文   时间:2014-05-26 11:22:57    阅读次数:204
JS类似Java String.format的函数
String.prototype.format = String.prototype.f = function () { var s = this, i = arguments.length; while (i--) { s = s.replace(new R...
分类:编程语言   时间:2014-05-26 10:49:23    阅读次数:356
Post These Up-Close Shots Of The Runway Bags
Here are some tips to guide you while shopping discount LV bags online. Look at the rack bag. Before you go out and buy handbags online, it is good to...
分类:其他好文   时间:2014-05-26 10:26:29    阅读次数:279
堆排序
#include#include#includeusing namespace std; //void MinHeapFixup(int a[], int i)//{// int j ,temp;// temp = a[i];// j = (i-1)/2;// while(j >= 0 && i !...
分类:其他好文   时间:2014-05-26 10:26:08    阅读次数:212
asp.net防SQL/JS注入攻击:过滤标记
/// /// 过滤标记/// /// 包括HTML,脚本,数据库关键字,特殊字符的源码 /// 已经去除标记后的文字public static string NoHTML(string Htmlstring){if (Htmlstring == null){return "";}else{//删除...
分类:数据库   时间:2014-05-26 08:38:42    阅读次数:345
c语言快速判断一个数是偶数还是奇数
#include int main() { int a; while(1) { printf("please input the number:\n"); scanf("%d",&a); if(a&1) { printf("%d是奇数\n",a); } else { printf("%d是偶数\n",a); } } return 0; }这...
分类:编程语言   时间:2014-05-26 03:36:15    阅读次数:367
lua入门之一:c/c++ 调用lua
#include //lua头文件 #ifdef __cplusplus extern "C" { #include "lua.h" #include #include } #else #include #include #include #endif int main(int argc,char ** argv) { lua_State * L=NU...
分类:编程语言   时间:2014-05-24 23:16:07    阅读次数:362
从一道面试题(死循环里分配内存)阐述Linux的内存管理
int cnt = 0; while(1) { ++cnt; ptr = (char *)malloc(1024*1024*128); if(ptr == NULL) { printf("%s\n", "is null"); break; } } printf("%d\n", cnt); 这个程序会有怎样的输出呢?...
分类:系统相关   时间:2014-05-24 21:59:47    阅读次数:479
【练习】P62
/*---分别对单链表和双链表,只使用指针来交换两个相邻的元素。---*/ /*-单链表版本-*/ #include #include struct Node{ int val; struct Node *next; }; Node *findEnd(Node *list){ while(list->next) list = list->next; return ...
分类:其他好文   时间:2014-05-24 19:41:49    阅读次数:253
【练习】P62页3.2题
/*---给你一个链表L和另一个链表P,它们包含以升序排列的整数。操作PrintLots(L,P) 将打印L中那些由P所指定位置上的元素。---*/ #include #include struct Node{ int val; struct Node *next; }; Node *findEnd(Node *list){ while(list->next) list = l...
分类:其他好文   时间:2014-05-24 14:27:42    阅读次数:224
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!