摘要: public class shuzu { public static void main(String[] args) { //数组 //类型+[] // int[]s; // // Spring[]str; // // //使用之前初始化大小 // int[]a=new int[5];//数组初始 阅读全文
posted @ 2016-02-27 14:00 百事没事 阅读(718) 评论(0) 推荐(0) 编辑
摘要: ---恢复内容开始--- //猴子吃桃 int a=1; for(int i=6;i>=1;i--) { a=(a+1)*2; } System.out.println(a); //象棋盘 double sum = 0; for (int i = 1; i <=1; i++) { double x= 阅读全文
posted @ 2016-02-27 08:55 百事没事 阅读(205) 评论(0) 推荐(0) 编辑
摘要: //输出三角形,菱形 //三角形由多到少,内外循环都是++ //三角形由少到多,内外循环相反,一个++,一个-- for(int i=1;i<=10;i++) { for(int j=1;j<=i;j++) { System.out.print("*"); } System.out.println( 阅读全文
posted @ 2016-02-26 15:43 百事没事 阅读(228) 评论(0) 推荐(0) 编辑
摘要: import java.util.Scanner; //自动生成:scanner+alt+/ public class xunhuanyuju { public static void main(String[] args) { //控制循环: //计数器 //int i=0;……i++; //提前 阅读全文
posted @ 2016-02-26 09:09 百事没事 阅读(307) 评论(0) 推荐(0) 编辑
摘要: for(int i=1;i<=9;i++) // { // for(int j=1;j<=i;j++) // { // System.out.print(j+"*"+i+"="+(i*j)); // System.out.print("\t"); // } // System.out.println 阅读全文
posted @ 2016-02-26 09:07 百事没事 阅读(221) 评论(0) 推荐(0) 编辑
摘要: public static void main(String[] args) { //水仙花数 // int a,b,c,d; // for(a=1;a<=9;a++) // { // for(b=0;b<=9;b++) // { // for(c=0;c<=9;c++) // { // d=a*1 阅读全文
posted @ 2016-02-26 08:36 百事没事 阅读(186) 评论(0) 推荐(0) 编辑
摘要: package HQ; import java.util.Scanner;//引入一个类。。scanner/ 自动生成 public class tiaojianyuju { public static void main(String[] args) { public static void ma 阅读全文
posted @ 2016-02-25 08:33 百事没事 阅读(319) 评论(0) 推荐(0) 编辑
摘要: 1.编写Java程序,声明两个int型变量,运用三元运算符判断两个变量是否相等,若不相等,求出两个数中较大的。 public class 练习题 { public static void main(String[] args) { 一 int a=2, b=3; int g=(a>b)?a:b; i 阅读全文
posted @ 2016-02-25 08:30 百事没事 阅读(16266) 评论(0) 推荐(1) 编辑
摘要: package HQ; /** * 类的声明 * @author lenovo * */ public class leixingzhuanhuan { /** * 方法的声明 * @param args * * * JAVA DOC * * * */ public static void main 阅读全文
posted @ 2016-02-23 08:29 百事没事 阅读(397) 评论(0) 推荐(0) 编辑
摘要: public class text1 { static int d=2; public static void main(String[]args){ //运算符 //赋值运算 “=” //int a1=1, //a=++a1; //System.out.println(a); //算术运算符+-* 阅读全文
posted @ 2016-02-23 08:27 百事没事 阅读(146) 评论(0) 推荐(0) 编辑