码迷,mamicode.com
首页 >  
搜索关键字:else    ( 23991个结果
js判断元素是否存在
//方法一if($('.div1').length==0){ alert('不存在');}else{ alert('存在');}//方法二if($('.div')){alert('存在');}else{ alert('不存在');}
分类:Web程序   时间:2015-04-05 20:15:20    阅读次数:119
Python判断语句
Python中只有一种判断语句,就是if..else..其中有三种常用的形式:1、只有if,没有elseif 判断条件: 执行语句2、有if又有elseif 判断条件: 执行语句else: 执行语句3、既有if,又有elif,又有elseif 判断条件: 执行语句elif 判断条件: 执行...
分类:编程语言   时间:2015-04-05 10:17:46    阅读次数:134
回档|数字三角形3,4
描述 数字三角形必须经过某一个点,使之走的路程和最大输入格式第1行n,表示n行 using namespace std;int map[26][26],f[26][26];int max(int a,int b){ if (a>b) return a; else return b;}int ma.....
分类:其他好文   时间:2015-04-05 09:01:07    阅读次数:98
很无聊的游戏1
将一个数不断地+1,*2,再平方,直到 > 1000000: 还好满足  Y-Combinate: ( lambda func, res, i: "." if res > 1000000 else str( res ) + ' ' + str( func( func, eval( str( res ) + ["+1", "*2", "**2"][i % 3]), i + 1 ) ) )( (...
分类:其他好文   时间:2015-04-04 23:51:04    阅读次数:321
python编写过滤指定字符的文本
#!/usr/bin/python #coding:utf-8 importos importstring importsys,getopt defGrep_start_char(Mpath,char): ifos.path.exists(Mpath): GrepFile=file(Mpath) else: return"Nosuchfileordirectory" try: forlineinhosts: ifline.startswith(char)orline.strip()==‘‘: conti..
分类:编程语言   时间:2015-04-04 16:55:52    阅读次数:144
ZOJ 3782 Ternary Calculation
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3782 题意:     求给定的算式的结果。 法一:      因为固定三个数字,两个运算符,直接if else就行。 代码: #include using namespace std; int main() { int t; char x,...
分类:其他好文   时间:2015-04-04 12:21:23    阅读次数:227
Java语言中的程序流程控制
(1.流程控制有三种基本技术可以改变程序的控制流程: A.调用方法 :将导致控制流程离开当前方法,转移到被调用的方法。 B.选择 : a. if / else语句 b. switch语句 c.三目运算 C.循环 :a. while循环 b. for 循环...
分类:编程语言   时间:2015-04-04 10:30:22    阅读次数:212
Python 学习笔记(第3课)
这一节,我们将学习Python的控制流语句,主要包括if、for、while、break、continue 和pass语句1. If语句if语句也许是我们最熟悉的语句。其使用方法如下:x=input("please input an integer:")if x0: print 'x>0'else:...
分类:编程语言   时间:2015-04-03 22:15:11    阅读次数:142
python中使用traceback来追踪异常
test1.py中,当分母为0的时候,调用系统退出#!/usr/bin/pythonimport sysdef division(a=1, b=1): if b==0: print 'b eq 0' sys.exit(1) else: re...
分类:编程语言   时间:2015-04-03 22:14:36    阅读次数:173
3个数比较大小输出最大值,为什么这个不对呢?求大神啊
#include void mian(){ int a,b,c,max; printf("Please enter a,b,c:"); scanf("%d%d%d",&a,&b,&c); if(a>b)max=a; else max=b; if(max>c)max=c; return(max); p...
分类:其他好文   时间:2015-04-03 17:04:09    阅读次数:130
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!