摘要: import java.util.Scanner;public class HDU1004 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = 0, f = 0; String a = null; while (sc.hasNext()) { n = sc.nextInt(); int pre = 0; if (n > 0 && n <= 100... 阅读全文
posted @ 2012-07-12 14:42 A_阿飞 阅读(112) 评论(0) 推荐(0)
摘要: import java.util.Scanner;public class HDU1003 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a, b, c, d, e, t, n, i, j; if (sc.hasNextInt()) { t = sc.nextInt(); for (j = 1; j <= t; j++) { n = sc.nextInt... 阅读全文
posted @ 2012-07-12 14:41 A_阿飞 阅读(143) 评论(0) 推荐(0)
摘要: import java.math.BigInteger;import java.util.Scanner;public class HDU1002 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = 1; int T = 0; BigInteger a; BigInteger b; BigInteger sum; T = sc.nextInt(); if ... 阅读全文
posted @ 2012-07-08 11:11 A_阿飞 阅读(180) 评论(0) 推荐(0)
摘要: import java.util.Scanner;public class HDU1001 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = 0; while (sc.hasNext()) { int sum = 0; n = sc.nextInt(); for (int i = 1; i <= n; i++) { sum +=... 阅读全文
posted @ 2012-07-08 11:09 A_阿飞 阅读(138) 评论(0) 推荐(0)
摘要: View Code import java.util.Scanner;public class HDU1000 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = 0; int b = 0; int sum = 0; while (sc.hasNext()) { a = sc.nextInt(); b = sc.nextInt(); ... 阅读全文
posted @ 2012-07-06 10:14 A_阿飞 阅读(113) 评论(0) 推荐(0)
摘要: /* * 1、定义一个飞机类,属性有飞机名,长度,载人数,载重数,起飞距离 方法 1) 起飞方法,打印从1开始循环,打印数字, 直到达到起飞距离后,打印结束(用for) 2) 降落方法, 打印飞机降落2)、定义一个直升机类继承飞机类,重写起飞方法 1) 起飞方法,直接打印飞机起飞3)、定义一个战斗机类继承飞机类,添加属性:装载武器 1)添加一个射击方法,打印向目标射击 *///开始public class Pigbrother { /** * @param args */ public... 阅读全文
posted @ 2012-02-21 20:06 A_阿飞 阅读(202) 评论(0) 推荐(0)