码迷,mamicode.com
首页 >  
搜索关键字:else    ( 23991个结果
jquery轻松操作CSS样式
$(this).click(function(){if($(this).hasClass(“zxx_fri_on”)){$(this).removeClass(“zxx_fri_on”);}else{$(this).addClass(“zxx_fri_on”);}return false;});添加...
分类:Web程序   时间:2014-08-21 18:35:04    阅读次数:317
jQuery判断iframe中元素是否存在的方法
jQuery判断iframe中元素是否存在的方法,需要的朋友可以参考一下 .代码 if($(window.frames["iframepage"].document).find('.l-grid-row-cell').length > 0){   alert(1); }else{   alert(2); } 判断id为iframepage的iframe中css为1-grid-row-cell的元素是否存在。...
分类:Web程序   时间:2014-08-21 15:05:24    阅读次数:219
测试CPU核心个数
//测试CPU核心个数#if !defined (_WIN32) && !defined (_WIN64)#define LINUX#include #else#define WINDOWS#include #endifunsigned core_count(){ unsigned count =....
分类:其他好文   时间:2014-08-21 13:08:44    阅读次数:157
寻找制定元素的指针
#include int search(int *apt,int n,int key)/*返回在数组中和key值相等值的下标*/ { int *p; for(p=apt;p<apt+n;p++) { if(*p==key) return p-apt; } return NULL;/*不可以在if下面直接else,因为得循环找出和key值相同的值,遍历完了发现没有才返回null*...
分类:其他好文   时间:2014-08-21 09:52:43    阅读次数:153
17个新手常见Python运行时错误
当初学 Python 时,想要弄懂 Python 的错误信息的含义可能有点复杂。这里列出了常见的的一些让你程序 crash 的运行时错误。1)忘记在if,elif,else,for,while,class,def声明末尾添加 :(导致 “SyntaxError :invalid syntax”)该错...
分类:编程语言   时间:2014-08-21 09:45:53    阅读次数:269
打印0~100之间被3或5整除的数
#include int main(){ int i = 0, j = 0; while (i j) { printf("[%d] ", j); j += 5; } else { ...
分类:其他好文   时间:2014-08-21 00:05:43    阅读次数:257
ATM
#include //密码函数void key(int k) { int i=0; do { if(k==123) { return 0; } else if(k!=123) { printf("密码错误!\n"); ...
分类:其他好文   时间:2014-08-20 20:59:02    阅读次数:241
PHP中递归函数的一个常见逻辑问题
首先,我们得知道递归函数是什么东西,通俗来讲也就是自己调用自己本身的函数。 现在需要设计一段代码,解决1到10阶乘的问题。 代码A: =1){ $tot+=$sum; add(--$sum); }else{ return $tot;...
分类:Web程序   时间:2014-08-20 16:32:12    阅读次数:162
关于判空
if(undefined){ alert('ok')}else{alert('no')} //noif(""){ alert('ok')}else{alert('no')} //noif(null){ alert('ok')}else{alert('no')}//noif(!null){ alert...
分类:其他好文   时间:2014-08-20 16:07:02    阅读次数:153
POJ 3675 Telescope 简单多边形和圆的面积交
这道题得控制好精度,不然会贡献WA QAQ还是那个规则:int sgn(double x){ if(x > eps) return 1; else if(x #include #include #include #include using namespace std;#defin...
分类:其他好文   时间:2014-08-20 12:14:22    阅读次数:368
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!