码迷,mamicode.com
首页 >  
搜索关键字:if then else    ( 23991个结果
比大小
#includeint main (){ #ifdef ONLINE_JUDGE #else freopen ("in.txt","r",stdin); #endif int n,m; int a[101]; while(scanf("%d",&n)!=EOF&&(na[k+1])...
分类:其他好文   时间:2014-11-23 22:52:28    阅读次数:245
给一个只包含 0, 1, * 的 String,将所有的* 替换成 0 或者 1, 返回所有的可能行
void GetAllString(int start, string & str, vector & res) { if (start == str.size()) { res.push_back(str); } else { ...
分类:其他好文   时间:2014-11-23 17:16:19    阅读次数:189
折半查找
#include using namespace std;int search(int key){ int i; int a[150]; for(i=0;i>a; num=search(a); if(num==0) { cout<<"您输入的数不存在"<<endl; } else cout<...
分类:其他好文   时间:2014-11-23 13:03:31    阅读次数:176
运用递归编写strlen函数实例
代码如下: #include int Strlen(const char *s) { if( NULL == s) return -1; if('\0' == *s) return 0; else return Strlen(s+1)+1; } int main() { printf("Strlen(\"123\")=%d\n",Strlen("123")); r...
分类:其他好文   时间:2014-11-22 10:41:55    阅读次数:204
启动设备管理器
/** * 激活设备管理器 * * @param context * 上下文对象 */ public static void activeApp(Context context) { if (context instanceof Activity) { activeApplication(context); } else...
分类:其他好文   时间:2014-11-21 20:31:59    阅读次数:165
查询sql2005&2008全部表信息
1 如果是查询sql server 2000,把sys.extended_properties修改为SysProperties 2 3 SELECT 4 表名 = CASE WHEN A.COLORDER=1 THEN D.NAME ELSE '' END, 5 表说明 =...
分类:数据库   时间:2014-11-21 20:25:22    阅读次数:285
char与TCHAR相互转化
char与TCHAR相互转化char strUsr[10] = "Hello";TCHAR Name[100];#ifdef UNICODE MultiByteToWideChar(CP_ACP, 0, strUsr, -1, Name, 100);#else strcpy(Name, ...
分类:其他好文   时间:2014-11-21 20:09:06    阅读次数:180
javascript 侧边栏一键分享移入移出效果
运动框架: 先要清除定时器,防止多次点击或者移入移出时,开启多个定时器,元素的运动会是所有定时器中运动的总和当达到目的时,要清除定时器(使用if/else 实现) N...
分类:编程语言   时间:2014-11-21 18:57:52    阅读次数:273
#ifdef、#if defined、#ifndef的使用
1.#ifdef和#if defined     注意两者都有个define的作用,区别在于使用方式上。前者的通常用法是: #ifdef  X    .... #else    .... #endif     只能在两者中选择是否有定义。对于后者,常用法是: #if defined x1    .... #elif defined x2    .... #elif de...
分类:其他好文   时间:2014-11-21 16:21:03    阅读次数:131
JQuery中的打印
利用IE自带的WebBrowser进行打印打印判断:if(factory.object)//打印设置的判断 factory.printing.PageSetup(); else alert("对不起!现在不支持!");if(factory.object)//打印预览...
分类:Web程序   时间:2014-11-21 16:07:49    阅读次数:265
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!