完成如下功能:1. 递归从后向前。 123456->654321def f(s): if len(s) == 1: print s else: print s[len(s) - 1], f(s[:len(s) - 1]) 2. 递归取两边 ...
分类:
其他好文 时间:
2015-09-23 16:17:17
阅读次数:
135
select p.id comperitorId,p.compcorp competitorName,sum(case when c.kindname = 'ATM' then c.num else 0 end) atm,sum(case when c.kindname = 'CRS' then ....
分类:
数据库 时间:
2015-09-23 10:31:02
阅读次数:
203
iOS7下改变UINavigationBar颜色if(floor(NSFoundationVersionNumber)<=NSFoundationVersionNumber_iOS_6_1){
//LoadresourcesforiOS6.1orearlier
self.navigationController.navigationBar.tintColor=[UIColorbrownColor];
}else{
//LoadresourcesforiOS7orlater
self.navig..
分类:
移动开发 时间:
2015-09-23 01:27:01
阅读次数:
159
1、if_else语句:else会与离它最近的尚未匹配的if匹配,所以当只使用一半的if时,最好用{}包起来2、switch语句:不要省略break;还有最后default;3、for语句:for语句头中定义的对象,只有在for循环体中可见for(int i = 0; i < n; i++) ...
分类:
其他好文 时间:
2015-09-22 21:40:43
阅读次数:
101
#include int MaxSub(int A[],int N){ return MaxSubSeq(A,0, N-1);}int Max3(int x, int y, int z){ if(x > y){ if(x > z){ return x; } else{ retur...
分类:
其他好文 时间:
2015-09-22 20:33:30
阅读次数:
271
1、运行时间[root@logicserver~]#uptime|sed-n‘/,/s/,//gp‘|awk‘{
>if($4=="days"||$4=="day")
>{print$2,$3,$4,$5}
>else
>{print$2,$3}}‘
up22:542、磁盘使用情况[root@logicserver~]#df-h
文件系统容量已用可用已用%%挂载点
/dev/sda250G40G6.9G86%/
tmpfs462M0..
分类:
其他好文 时间:
2015-09-22 19:02:44
阅读次数:
139
流程控制语句控制语句,即用来实现对程序流程的选择、循环、转向和返回等进行控制的语句。Bash中的控制语句有几种控制语句?额,小编也没统计过,不清楚哎!!按照百度百科的分类(选择语句,循环语句,转向语句)总结了几个。然后看下吧!一、选择语句1、if……else……fi格式..
分类:
系统相关 时间:
2015-09-22 19:02:34
阅读次数:
350
通过下面的例子,来了解integer比较大小需注意的几点。eg.定义Integer对象a和b,比较两者结果为:a不等于b1 Integer a = 1;2 Integer b = 1;3 if(a==b){4 System.out.print("a等于b"); 5 }else{6 Syst...
分类:
其他好文 时间:
2015-09-22 18:19:28
阅读次数:
168
object Main extends App { def Fibonacci1(n: Int): Int = { if (n == 1 || n == 0) 1 else Fibonacci1(n - 1) + Fibonacci1(n - 2) } def Fibon...
分类:
其他好文 时间:
2015-09-22 18:13:45
阅读次数:
121
import java.util.Scanner;public class if_else3{ public static void main(String[] args) { Scanner s=new Scanner(System.in); System.out.prin...
分类:
编程语言 时间:
2015-09-22 07:46:13
阅读次数:
176