摘要:
f(n)=f(n-1)+10^n; public static void main(String[] args) { int n=2017; long temp=1; for(int i=1;i<n;i++){ temp+=func(i); } System.out.println(temp); } 阅读全文
摘要:
private static int func(int count) { // TODO Auto-generated method stub int cou = 0; if(count==1){ cou=1; } else if(count==2){ cou=2; } else{ for(int 阅读全文
摘要:
/** * 在一个二维数组中,每一行都按照从左到右递增的顺序排序, * 每一列都按照从上到下递增的顺序排序。请完成一个函数, * 输入这样的一个二维数组和一个整数,判断数组中是否含有该整数。 * * 思路 : * 从左下角最后一个元素开始比较,如果target小于这个元素向上遍历否则向右遍历 */ 阅读全文
摘要:
/** * 冒泡排序 */ public static void Bubble(int[] array){ for(int i=0;i<array.length-1;i++){ for(int j=0;j<array.length-1-i;j++){ if(array[j]>array[j+1]){ 阅读全文