首先要区别OC和swift中if 判断的不同之处
var str = “sssss”
在OC中if(str)是对的,表示判断str !=nil 是否为true
但是在swift中直接写 if str这种写法是错误,可以改成if str != nil
如果想写成 if str ,那么在声明的时候要这么写 var str? = “sssss”
swift中在if语句中,条件必须是一个...
分类:
其他好文 时间:
2014-08-15 14:38:18
阅读次数:
143
Chess
Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 509 Accepted Submission(s): 198
Problem Description
小度和小良最近又迷上了下棋。棋盘一共有N行M列,...
分类:
其他好文 时间:
2014-08-15 14:37:48
阅读次数:
212
Description
F- Hats
Background
John Hatman, the honest cloakroom attendant of the RoyalTheatre of London, would like to know the solution to the followingproblem.
TheProble...
分类:
其他好文 时间:
2014-08-15 14:37:28
阅读次数:
208
给一颗树,1为根,要求遍历树上所有点,给出叶子结点的访问顺序,限制每条边至多访问两次。
首先这是一棵树,那么两点之间的路线是确定的,所以我第一遍dfs预处理出从根节点到每个叶子的路径保存,以便后面输出。
那么就按照题目要求输出叶子结点的顺序依次输出,然后从一个叶子到下一个叶子的时候,从他们的最近公共祖先转折,所以我还预处理了相邻两个叶子结点的LCA。
#include...
分类:
其他好文 时间:
2014-08-15 14:37:08
阅读次数:
220
Keywords Search
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768
K (Java/Others)
Problem Description
...
分类:
其他好文 时间:
2014-08-15 14:36:48
阅读次数:
201
1 1 var canvas=document.getElementById("canvas"); 2 var cxt=canvas.getContext("2d"); 3 cxt.beginPath(); 4 cxt.moveTo(250,50); 5 cxt.l...
分类:
其他好文 时间:
2014-08-15 14:35:59
阅读次数:
177
写过一段时间单片机程序,也看了一些单片机程序,书上的,网上的,基本都是非常原始的读取按键,延时判断,这些按键相关代码穿插于整个程序,着实不够美观,最重要的是不能复用,so俺就想做个按键框架,只需提供按键处理代码即可,言归正传,先简介一下几个文件,ringfifo.c提供了一个简单的环形缓冲队列,用以...
分类:
其他好文 时间:
2014-08-15 14:35:49
阅读次数:
394
package request;import java.io.IOException;import javax.servlet.ServletException;import javax.servlet.http.HttpServlet;import javax.servlet.http.HttpS...
分类:
其他好文 时间:
2014-08-15 14:35:28
阅读次数:
129
He or she dug near some plants cheap Michael Kors in pots citrus tomato vegetables, Placing dirt about the top for this fibres engaged in realisticall...
分类:
其他好文 时间:
2014-08-15 14:35:18
阅读次数:
222
Play on WordsSome of the secret doors contain avery interesting word puzzle. The team of archaeologists has to solve it to open that doors. Because th...
分类:
其他好文 时间:
2014-08-15 14:34:48
阅读次数:
216
ShortcutEnglishComputerese?new lineinsertNewline:??new line (don't leave form box)1insertNewlineIgnoringFieldEditor:?new lineinsertNewline:??new line ...
分类:
其他好文 时间:
2014-08-15 14:34:38
阅读次数:
148
Problem FOrdering TasksInput: standard inputOutput: standard outputTime Limit: 1 secondMemory Limit: 32 MBJohn has n tasks to do. Unfortunately, the t...
分类:
其他好文 时间:
2014-08-15 14:34:28
阅读次数:
141
Problem D: XYZZYADVENT: /ad?vent/, n. The prototypical computer adventure game, first designed by Will Crowther on the PDP-10 in the mid-1970s as an a...
分类:
其他好文 时间:
2014-08-15 14:34:08
阅读次数:
194
查询某个表中是否有数据的时候,我用了ExecuteNonQuery(),并通过判断值是否大于0来判断数据的存在与否。结果与我所设想的很不一致,调试时才发现,其执行后返回的结果是-1,对此我很是不理解,回头查了下资料,如下显示: SqlCommand.ExecuteNonQuery 方法对连接执行 T...
分类:
其他好文 时间:
2014-08-15 14:33:48
阅读次数:
243
一般来说当我们创建自定义集合的时候为了让其能支持foreach遍历,就只能让其实现IEnumerable接口(可能还要实现IEnumerator接口)但是我们也可以通过使用yield关键字构建的迭代器方法来实现foreach的遍历,且自定义的集合不用实现IEnumerable接口注:虽然不用实现I....
分类:
其他好文 时间:
2014-08-15 14:33:18
阅读次数:
202
1 1 var canvas=document.getElementById("canvas"); 2 var cxt=canvas.getContext('2d'); 3 cxt.lineWidth=10; 4 cxt.beginPath(); 5 cxt.mo...
分类:
其他好文 时间:
2014-08-15 14:33:08
阅读次数:
278
在c#中用到了状态栏控件StatusStrip,但当我想把StatusStrip上某个StatusLabel靠右对齐时出了问题。 按照MSDN中的办法,是设置ToolStripStatusLabel的Alignment属性为Right。不过我在设计界面的属性窗口中找不到Alignment。就算加入代...
分类:
其他好文 时间:
2014-08-15 14:32:48
阅读次数:
184