摘要: 输入一个整数n(n<10),输出1-n的全排列 1 import java.util.Scanner; 2 public class One { 3 //数组a(模拟放数字牌的盒子)用于存放排序数字,数组book[i]用于标记牌i是否已经放入数组a 4 public static int a[]=n 阅读全文
posted @ 2017-04-29 21:38 Major^-^ 阅读(1064) 评论(0) 推荐(0)
摘要: 1 import java.util.Scanner; 2 3 public class One { 4 //n,m为迷宫的行列范围,p,q是某人迷路所在地点,min用于记录走到终点最小路径的步数 5 public static int n,m,p,q,min=9999; 6 //数组a是迷宫,1代 阅读全文
posted @ 2017-04-29 21:37 Major^-^ 阅读(406) 评论(0) 推荐(0)
摘要: 1 public class One { 2 //叫数字小游戏 3 public static void main(String args[]){ 4 Scanner in=new Scanner(System.in); 5 String regex="-?[0-9]+";//用来判断是否为数字 6 阅读全文
posted @ 2017-04-25 17:25 Major^-^ 阅读(240) 评论(0) 推荐(0)
摘要: return:遇到return,马上结束函数(停止return后面任何操作)并返回函数类型的数据(可以是void,即单纯结束函数) 1 public class Two { 2 public static void main(String args[]){ 3 int a[]={1,2,4,2,5, 阅读全文
posted @ 2017-04-20 21:20 Major^-^ 阅读(223) 评论(0) 推荐(0)
摘要: 1 public class A{ 2 public static void main(String args[]){ 3 int n='A'+'0';//因为int级别比char高,所以char计算结果可以直接赋值给int类型变量 4 System.out.println(n); 5 } 6 } 阅读全文
posted @ 2017-03-18 15:36 Major^-^ 阅读(170) 评论(0) 推荐(0)
摘要: https://jingyan.baidu.com/article/5bbb5a1b1f4c7613eba1790d.html 阅读全文
posted @ 2017-03-15 17:43 Major^-^ 阅读(153) 评论(0) 推荐(0)
摘要: 1 public class Example8_1 { 2 public static void main(String args[]){ 3 RedCowForm form=new RedCowForm("红牛农场"); 4 form.showMess(); 5 } 6 } 7 8 class R 阅读全文
posted @ 2017-03-10 19:06 Major^-^ 阅读(334) 评论(0) 推荐(0)
摘要: 1 publilc class Shuzu{ 2 public static void main(String ags[]){ 3 { 4 int a[]={1,2,3,4}; 5 char b[]={a,b,c,d}; 6 for(int i=0;i<a.length;i++){ 7 System 阅读全文
posted @ 2017-03-05 21:44 Major^-^ 阅读(180) 评论(0) 推荐(0)
摘要: 1 public class One{ 2 public static void main(String args[]){ 3 String s1,s2; 4 s1=new String("天道酬勤"); 5 s2=new String("天道酬勤"); 6 System.out.println(s 阅读全文
posted @ 2017-03-05 10:46 Major^-^ 阅读(268) 评论(0) 推荐(0)