显示计算机界面

摘要: import java.awt.*;public class jsjjm { public static void main (String arg[]) { Frame f=new Frame("GridLayout"); f.setLayout(new GridLayout(6,4));//容器 阅读全文
posted @ 2017-05-23 17:01 可小乐 阅读(107) 评论(0) 推荐(0) 编辑

完善3.2

摘要: public class MyDate { //声明公有类private int year,month,day; //私有成员函数变量private static int thisYear; //私有静态成员函数变量static //初始化静态成员变量{thisYear =2012;}public 阅读全文
posted @ 2017-05-16 16:26 可小乐 阅读(64) 评论(0) 推荐(0) 编辑

杨辉三角形

摘要: public class YangHui {public static void main(String args[]){int a[][]=new int[8][8];int i,j ;for(i=0;i<8;i++){for(j=0;j<8;j++){a[i][0]=1;a[i][i]=1;}} 阅读全文
posted @ 2017-03-28 17:42 可小乐 阅读(65) 评论(0) 推荐(0) 编辑

100以内的素数

摘要: public class test { public static void main(String[] args) { int i,n,k=0; for (n = 3; n<=100; n++) { i=2; while (i<n) { if (n%i==0) break; i++; } if ( 阅读全文
posted @ 2017-03-21 13:38 可小乐 阅读(82) 评论(0) 推荐(0) 编辑

九九乘法表

摘要: package hello; public class test { public static void main(String[] args) { for (int i=1;i<=9;i++) { for(int j=1;j<=i;j++) { if(j>1) { System.out.prin 阅读全文
posted @ 2017-03-21 13:30 可小乐 阅读(115) 评论(0) 推荐(0) 编辑