摘要: package com.chongrui.test; /* *三维数组的初始化及遍历 * */ public class test { public static void main(String[] args) { int a[][][]=new int[][][]{ {{1,2,3},{4,5, 阅读全文
posted @ 2017-01-15 22:30 tantanba 阅读(5369) 评论(0) 推荐(0) 编辑
摘要: package com.chongrui.test; /* *二维数组的初始化 * */ public class test { public static void main(String[] args) { int a[][]=new int[3][4]; System.out.println( 阅读全文
posted @ 2017-01-15 22:09 tantanba 阅读(182) 评论(0) 推荐(0) 编辑
摘要: package com.chongrui.test; /* *用while判读循环语句1+1/2!+1/3!+...1/20!的和 *使用BigDecimal类完成大数字与高精度运算 * */ import java.util.Scanner;import java.math.BigDecimal; 阅读全文
posted @ 2017-01-15 21:56 tantanba 阅读(2618) 评论(0) 推荐(0) 编辑
摘要: package com.chongrui.test; /* *求一组数组各个元素的和* * */ import java.util.Scanner;public class test { public static void main(String[] args) { int[] num = {18 阅读全文
posted @ 2017-01-15 15:15 tantanba 阅读(307) 评论(0) 推荐(0) 编辑
摘要: package com.chongrui.test; /* *求一组数组各个元素的和* * */ import java.util.Scanner;public class test { public static void main(String[] args) { int[] num = {1, 阅读全文
posted @ 2017-01-15 15:01 tantanba 阅读(566) 评论(0) 推荐(0) 编辑
摘要: package com.chongrui.test; /* *使用for循环输出杨辉三角杨辉三角形由数字排列,可以把它看作一个数字表,其基本特征是两侧的数值均为1,其他位置的数值是其正上方的数值与左上角数值之和。 创建YanghuiTriangle类,在该类的主方法中创建一个二维数组,并指定二维数组 阅读全文
posted @ 2017-01-15 14:48 tantanba 阅读(354) 评论(0) 推荐(0) 编辑
摘要: 之前已经成功写过一次代码,今天重新看这个题目时,一下子又没了思路,在草稿纸上比划了大概十分钟才想到实现的思路。思路跟上次实现的完全一样,发现时间长了就忘记了!真是好记性不如烂笔头,何况我这么差的记性呢!现把解决该问题时,自己的思路写下来分享一下。(注意重点看我怎么思考的,不要一下子就看代码) 图 1 阅读全文
posted @ 2017-01-15 14:18 tantanba 阅读(424) 评论(0) 推荐(0) 编辑