码迷,mamicode.com
首页 >  
搜索关键字:do while    ( 38720个结果
POJ 1163 The Triangle (简单线性dp)
OJ题目 : click here~~ 题目分析:给一个数字三角形,从最上面一个数字开始,方向只能往左下或者右下,一直到最后一行,求经过的所有数字和的最大值。 搞清楚在输入的数据中,route的方向就行。 AC_CODE int num[102][102]; int main(){ int n , i , j , k ; while(cin >> n){ ...
分类:其他好文   时间:2014-07-22 23:05:55    阅读次数:372
Do you really know what means initialization? “初始化 定义 赋值” 之间的联系与区别
“初始化 定义 赋值” 之间的联系与区别              本来很早之前就想写个blog,说说这三个家伙的区别和联系,三者之间各种联系,很难比较清楚的讲明白,感觉当时好像分析思路还不够“完整”。今天遇到别人抛出来的一个问题。根本的问题是和初始化和赋值有关系,于是留下这个blog。 #include struct _ANIBMP { int FirstNu...
分类:其他好文   时间:2014-07-22 23:04:54    阅读次数:384
玩转web之servlet(六)---session介绍及简单使用(登录验证中保存信息)
在浏览器与服务器进行交互时,往往需要把涉及到的一些数据保存下来,这时就需要使用cookie或session进行状态管理。 这篇文章先来说说session怎么用,首先在servlet中创建一个session来保存信息,举个例子,在做登陆验证时,如果登陆成功,需要将用户的信息保存到session中,怎么保存呢?下面给出代码: public class Login_Do extends HttpS...
分类:Web程序   时间:2014-07-22 23:03:52    阅读次数:355
Lua基础(二)——表
表 a = { } b = { x = 1, ["hello, "] = "world!" } a.astring = "ni, hao!" a[1] = 100 a["a table"] = b function foo() end function bar() end a[foo] = bar --分别穷举表a和b for k, v in pairs(a) do print(k, "=>",...
分类:其他好文   时间:2014-07-22 23:00:33    阅读次数:261
[递推dp] zoj 3747 Attack on Titans
题目链接: http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=5170 Attack on Titans Time Limit: 2 Seconds      Memory Limit: 65536 KB Over centuries ago, mankind faced a new enemy, th...
分类:其他好文   时间:2014-07-22 23:00:16    阅读次数:536
整数加减法练习
程序自动产生随机数(srand 设置种子为系统时间,以保证每次运行程序产生的随机数有差别 ),然后用户输入结果,程序判断用户输入是否正确减法运算时要保证随机产生的a要大于b(用while循环判断,当然前提条件是用户选择的为减法运算,这里只保证式子产生的结果为非负整数)。#include #inclu...
分类:其他好文   时间:2014-05-01 23:59:45    阅读次数:499
Leetcode:Rotate Image 旋转图片
You are given an n x n 2D matrix representing an image. Rotate the image by 90 degrees (clockwise). Follow up: Could you do this in-place? 刚开始没有思路,但是自己举了几个简单的栗子才看出规律:需要一圈儿一圈儿的变换位置。有两层for循环:外...
分类:其他好文   时间:2014-05-01 18:33:34    阅读次数:359
Eclipse中使用Ant打Android包报错解决方案 – Perhaps JAVA_HOME does not point to the JDK
问题描述: 在Eclipse中运行ant批量打包工具出错,日志信息如下: D:\Android\android-sdk-windows\tools\ant\build.xml:601: The following error occurred while executing this line: D:\Android\android-sdk-windows\tools\ant\bui...
分类:移动开发   时间:2014-04-30 22:48:39    阅读次数:359
libpcre.so.1 cannot be found
./nginx: error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory...
分类:其他好文   时间:2014-04-30 22:43:38    阅读次数:346
Lua chapter 1
1. 调用其他的.lua文件   dofile("xx.lua");   2. 避免用 "_VERSION"这类的标识符,Lua将这类标识符用作特殊用途,通常保留"_"作为”哑变量“ 3. Lua的一些保留字:    do in local nil until 等     4. 注释:-- 表示行注释   --[[ ... ]] 表示块注释 一般的块注释这样写: --[[ ...
分类:其他好文   时间:2014-04-30 22:34:38    阅读次数:270
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!