码迷,mamicode.com
首页 >  
搜索关键字:循环 if for while case    ( 74454个结果
流程图与C语言的关系
学C语言的第一堂课,便被着重的提了流程图。记得最被邹爱掐(老师)常挂在嘴边的话就是,会写代码的不一定会流程图,会流程图的一定会写代码。想当然,同学之中(当然也包括我),谁也不会在做题前画一个流程图,但是当中的道理却是杠杠的!先展示一下,流程图所需的图形:C语言种有三个结构:顺序结构,选择结构和循环结...
分类:编程语言   时间:2014-06-02 10:07:57    阅读次数:270
poj2864
1 #include 2 #include 3 #include 4 using namespace std; 5 int main () 6 { 7 int n,m; 8 while(scanf("%d %d",&m,&n)&&m&&n) 9 {10 in...
分类:其他好文   时间:2014-06-02 06:25:12    阅读次数:158
dojo 学习笔记之dojo.query - query(id) 与query(class)的区别
考虑这个例子:动态创建一个页面的时候,用new listtem()生成多个listitem, 且每个listitem中都生成一个按钮button。 如果想要给每个按钮都绑定一个click事件,用dojo.query来获取这些button是比较方便的。 这样做的时候我遇到一个问题, 在create这些button的循环语句中我给每个button 定义了id = "somebtn" 。 ...
分类:其他好文   时间:2014-06-02 05:33:00    阅读次数:239
执行srvctl报错 :error while loading shared libraries: libpthread.so.0:
执行srvctl是报错 errorwhileloadingsharedlibraries:libpthread.so.0: [oracle@rac02~]$srvctl /opt/ora10g/product/10.2.0/db_1/jdk/jre/bin/java:errorwhileloadingsharedlibraries:libpthread.so.0: cannotopensharedobjectfile:Nosuchfileordirectory 查看srvctl命令..
分类:其他好文   时间:2014-06-02 04:09:00    阅读次数:285
LeetCode Sort Colors
class Solution { public: void swap(int &a,int &b) { int t=a; a=b; b=t; } void ksort(int l,int h,int a[]) { if(h<l+2) return; int e=h,p=l; while(...
分类:其他好文   时间:2014-06-02 03:01:26    阅读次数:206
选择结构的程序设计和循环结构的程序设计
if语句eg:#includeint main(void){ int age; scanf("%d",&age); if(age>18){ printf("您已经是成年人了!"); }}if -else语句eg:#includeint main(void){ int age; scanf("%...
分类:其他好文   时间:2014-06-02 01:44:09    阅读次数:225
Haskell递归
maximum函数取一组可排序的 List(属于 Ord Typeclass) 做参数,并回传其中的最大值。想想,在命令式风格中这一函数该怎么实现。很可能你会设一个变量来存储当前的最大值,然后用循环遍历该 List,若存在比这个值更大的元素,则修改变量为这一元素的值。到最后,变量的值就是运算结果。唔...
分类:其他好文   时间:2014-06-02 00:11:06    阅读次数:412
【leetcode】N-queens II
问题: 返回N皇后问题解的个数。 分析: 详见 N-queens 实现: bool nextPermutation(vector &num) { int i = num.size() - 1; while (i >= 1) { if(num[i] > num[i - 1]) { --i; int ii = num.size() - 1; while (i...
分类:其他好文   时间:2014-06-01 18:24:45    阅读次数:398
lua 语句学习
就如同C里的if else,while,do,repeat;就看lua里怎么用: 1、首先看if else t = {1,2,3} local i = 1 if t[i] and t[i] % 2 == 0 then print("even") else print("odd") end lua木有C里的&&,而是and来表示;if 之后跟表达式,之后要更个then 最后语句结束都要...
分类:其他好文   时间:2014-06-01 18:13:48    阅读次数:567
java-第六章-for-循环录入会员信息
importjava.util.Scanner; publicclassA02{ publicstaticvoidmain(String[]args){ //TODOAuto-generatedmethodstub Scannerinput=newScanner(System.in); System.out.println("MyShoPing管理系统>客户信息管理>添加客户信息\n"); intNo=0; StringBirthday="..
分类:编程语言   时间:2014-06-01 13:20:03    阅读次数:269
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!