杨辉三角的JAVA实现

摘要: public class yanghui_triangle{ public static void main(String[] args){ int[][] n = new int[10][21]; n[0][10] = 1; for(int i=1;i<10;i++) for(int j=10-i 阅读全文
posted @ 2018-03-31 21:30 xiangweilu 阅读(136) 评论(0) 推荐(0) 编辑

N!的JAVA实现

摘要: public class factorial{ public static void main(String[] args){ System.out.println(fact(10)); } private static long fact(int n){ if(n==1) return 1; el 阅读全文
posted @ 2018-03-31 21:22 xiangweilu 阅读(150) 评论(0) 推荐(0) 编辑