- 博客(4)
- 资源 (1)
- 收藏
- 关注
原创 java版菱形矩阵
用循环做完了。。 老师要求用递归做。。。 哎 有点思路 写写看 /** * 1 * 2 9 8 * 3 10 13 12 7 * 4 11 6 * 5 * * */ class Test2 { public static void main(String[] args) { int n
2013-03-29 20:11:25 910
原创 用递归做螺旋矩阵 java版算法
//这是用递归写出来的。。 不知道写的怎么样。。但是自己做的 public class Test1 { public static void main(String[] args) { int n = 10; int x=0,y=0,count =0; int[][] arr = new int[n][n]; count = arr[x][y] = 1; test1(arr,x,y,
2013-03-29 12:39:36 994
原创 算法-java版算法竞赛入门解题代码-第3章习题
//例题3-1 //开灯问题 public class test3_1 { public static void main(String[] args) { int n = 7; int k = 3; boolean[] b= new boolean[n+1]; for (int j = 2; j for (int i = 1; i if(i%2==0){ //如果是2的
2013-03-28 13:08:02 545
原创 算法-java版算法竞赛入门解题代码-第2章习题
//2-1 public class Test1 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.println("请输入一个数:"); long num = sc.nextLong(); System.out.println(" 位数:"+test1(
2013-03-28 13:01:37 652
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人