随笔分类 -  Java

摘要:1 import java.util.Scanner; 2 3 /** 4 * @author Administrator 折半查找 5 */ 6 public class zhebansousuo { 7 8 public static void main(String[] args) { 9 int[] a = new int[100];10 int x, b;11 Scanner cin = new Scanner(System.in);12 x = cin.nextInt();13 14 ... 阅读全文
posted @ 2013-12-10 22:41 天天AC 阅读(291) 评论(0) 推荐(0)
摘要:1 interface Car 2 { 3 // 汽车名称 4 String getName(); 5 6 // 获得汽车售价 7 int getPrice(); 8 } 9 // 宝马10 class BMW implements Car11 {12 public String getName()13 {14 return "BMW";15 }16 17 public int getPrice()18 {19 return 300000;20 }21 }22 // 奇瑞QQ23... 阅读全文
posted @ 2013-12-09 22:35 天天AC 阅读(169) 评论(0) 推荐(0)
摘要:1 import java.util.Scanner; 2 3 public class Test13 { 4 public static void main(String[] args) { 5 Scanner scan = new Scanner(System.in); 6 int num, temp; 7 int[] arr = new int[10]; 8 int i, len; 9 10 num = scan.nextInt();11 temp = num;12 i = 0;13 while(temp > 0){14 arr[i++] ... 阅读全文
posted @ 2013-12-08 07:28 天天AC 阅读(224) 评论(0) 推荐(0)
摘要:(1)这次的课程设计,基于CS架构首先解释一下CS和BS: CS架构的优点就是基于客户机和服务器模式,大部分的运算是在客户机上运行,从而提高一定的效率,但是也因为他在客户机上运行,所以要安装客户端,也导致了软件维护和升级时的不方便,需要程序员亲自进行升级配置。 BS架构的优点在于,软件维护和升级方便,只要能上网就能升级了且在很多地方都能够直接使用软件,而不需要安装,前提是你要能登陆到服务器。 阅读全文
posted @ 2013-12-07 09:00 天天AC 阅读(1292) 评论(0) 推荐(0)
摘要:1 import java.util.Scanner; 2 3 public class ArrayTest { 4 5 public static void main(String[] args) { 6 int n, m; 7 Scanner cin = new Scanner(System.in); 8 n = cin.nextInt(); 9 m = cin.nextInt();10 toBin(n);11 toHex(m);12 }13 14 public s... 阅读全文
posted @ 2013-12-05 19:16 天天AC 阅读(325) 评论(0) 推荐(0)
摘要:(1)常规的大星********************上面的java程序为 1 public class daxing { 2 3 public static void main(String[] args) { 4 5 for (int i = 0; i < 5; i++) { 6 for (int j = 0; j < 5; j++) { 7 System.out.print("*"); 8 } 9 System.out.println();10 ... 阅读全文
posted @ 2013-12-01 19:36 天天AC 阅读(582) 评论(0) 推荐(0)
摘要:直接上代码------------------------java------------------------Math.random() 1 import java.util.Scanner; 2 3 public class Random { 4 5 public static void main(String[] args) { 6 int n; 7 Scanner cin = new Scanner(System.in); 8 System.out.println("请输入要产生的随机数的个数"); 9 n ... 阅读全文
posted @ 2013-11-26 21:20 天天AC 阅读(290) 评论(0) 推荐(0)