// 安全释放
#define RELEASE_SAFELY(__Pointer) do{[__Pointer release],__Pointer = nil;} while(0)
// 屏幕的物理高度
#define ScreenHeight [UIScreen mainScreen].bounds.size.height
// 屏幕的物理宽度
#define ScreenWidth...
分类:
其他好文 时间:
2014-06-25 19:58:31
阅读次数:
197
来总结下求阶乘的各种方法哈。写在最前:①各个代码仅仅是提供了求阶乘的思路,以便在实际须要时再来编码,代码并不健壮!②各个程序都在1到10内測试正确。 代码一:#includeusing namespace std;int fac(int);int main(){ int n; while(cin>>...
分类:
编程语言 时间:
2014-06-25 19:02:43
阅读次数:
279
循环包括1 .while(){ ++;}while循环,需要先进行判断,才能执行。(注:添加++,结束循环)例:输100次int i = 0;while(ia[j+1]){temp = a[j];//存第一个元素a[j] = a[j+1];//把第二个元素赋给第一个a[j+1] = temp;//....
分类:
其他好文 时间:
2014-06-25 16:44:25
阅读次数:
143
用了while, do...while, for in, for in ...var i = 0var temp = 0while i < 1000 { temp += i i++}println(temp)var j = 0var temp2 = 0do { te...
分类:
其他好文 时间:
2014-06-25 15:56:28
阅读次数:
165
1.Could not find gem 'sqlite3 (>= 0)' in any of the gem sources listed in you
r Gemfile
2.ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions into the /usr/local/lib/ruby/gems/1.9.1 director.y
3.rails 3遇到 Could n...
分类:
其他好文 时间:
2014-06-24 22:18:45
阅读次数:
316
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<time.h>
intmain()
{
inta[]={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16};
intn=16;
inti,j,T=1000,tmp;
srand(unsigned(time(NULL)));
while(T--)
{
i=rand()%n;
j=rand()%..
分类:
编程语言 时间:
2014-06-24 16:30:44
阅读次数:
259
C语言中宏的使用(#,##,do…while(0)宏)
1.预定义宏的使用__FILE__,__FUNCTION__,__LINE__。
#include
void fun(void)
{
char v1;
short v2;
int v3;
long v4;
printf("v1: %x\n",&v1);
printf("v2: %x\n",&v2);
print...
分类:
编程语言 时间:
2014-06-24 15:29:13
阅读次数:
214
If you feel like crying you shouldn’t hold back your tears. You should let it all out while you still can, because when you get bigger sometimes you ....
分类:
其他好文 时间:
2014-06-24 14:53:38
阅读次数:
255
控制流Swift提供了所有c类语言的控制流结构。包括for和while循环来执行一个任务多次;if和switch语句来执行确定的条件下不同的分支的代码;break和continue关键字能将运行流程转到你代码的另一个点上。除了C语言传统的for-condition-increment循环,Swift...
分类:
其他好文 时间:
2014-06-24 11:57:14
阅读次数:
202
JS正则表达式获取分组内容。支持多次匹配的方式:var testStr = "now test001 test002"; var re = /test(\d+)/ig; var r = ""; while(r = re.exec(testStr)) { alert(r[0] + " " + r[1]...
分类:
Web程序 时间:
2014-06-24 11:27:32
阅读次数:
220