RFC

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

2012年3月10日

摘要: POJ2255提交总是RE,留个坑,等AC后填上。----------------------------------------找到了之前RE的问题:java太坑爹了,用Scanner.hasNext()居然会把回车也吃掉。后来改成hasNextLine(),可是出现的竟然是WA。这这这。。。出现WA的代码如下,如果您发现问题了,请多指教,谢谢~~import java.util.Scanner;public class _2255 { static String pre, in; static char[] post = new char[100]; static int... 阅读全文
posted @ 2012-03-10 21:42 hongxuchen 阅读(220) 评论(0) 推荐(1) 编辑

摘要: POJ3094import java.util.Scanner;public class _3094 { public static void main(String[] args){ String str; Scanner sc = new Scanner(System.in); int sum; while(sc.hasNextLine()){ str = sc.nextLine(); if(str.equals("#"))return; sum = 0; ... 阅读全文
posted @ 2012-03-10 16:42 hongxuchen 阅读(149) 评论(0) 推荐(0) 编辑

摘要: POJ3006 1 import java.util.Scanner; 2 import java.util.StringTokenizer; 3 4 public class _3006 { 5 6 public static boolean isPrime(int n) { 7 if (n < 2) 8 return false; 9 for (int i = 2; i * i <= n; i++) {10 if (i * (n / i) == n)11 return... 阅读全文
posted @ 2012-03-10 13:02 hongxuchen 阅读(166) 评论(0) 推荐(0) 编辑

2012年3月7日

摘要: POJ1503解法一:BigIntegerimport java.math.BigInteger;import java.util.Scanner;/* * 3408K 704MS */public class _1503 { public static void main(String[] args){ Scanner sc = new Scanner(System.in); BigInteger bi = new BigInteger("0"); String str; while(!(str = sc.nextLine(... 阅读全文
posted @ 2012-03-07 21:08 hongxuchen 阅读(246) 评论(0) 推荐(0) 编辑

摘要: POJ2262import java.util.Scanner;public class _2262 { public static boolean isPrime(int num){ for(int i = 3; i * i <= num; i += 2){ if (i * (num/i) == num)return false; } return true; } public static void main(String[] args){ Scanner sc = new Scanne... 阅读全文
posted @ 2012-03-07 00:06 hongxuchen 阅读(301) 评论(0) 推荐(0) 编辑

2012年3月6日

摘要: POJ1083import java.util.Scanner;public class _1083 { public static final int MAX = 400; public static void main(String[] args) { int from, to, max_time; int times[] = new int[MAX + 1]; Scanner sc = new Scanner(System.in); int count = sc.nextInt(); whi... 阅读全文
posted @ 2012-03-06 23:20 hongxuchen 阅读(178) 评论(0) 推荐(0) 编辑

摘要: POJ2739 1 import java.util.Scanner; 2 3 public class _2739 { 4 public static final int MAX = 10001; 5 private static boolean[] com = new boolean[MAX]; 6 7 public static void findPrime() { 8 for (int i = 2; i * i <= MAX; i++) { 9 if (!com[i]) {10 for ... 阅读全文
posted @ 2012-03-06 20:22 hongxuchen 阅读(204) 评论(0) 推荐(0) 编辑

摘要: POJ2159import java.util.Arrays;import java.util.Scanner;public class _2159 { public static void main(String[] args){ String first,second; Scanner sc = new Scanner(System.in); while(sc.hasNextLine()){ int cnt1[] = new int[26]; int cnt2[] = new int... 阅读全文
posted @ 2012-03-06 00:21 hongxuchen 阅读(135) 评论(0) 推荐(0) 编辑

2012年3月4日

摘要: 还是觉得写代码的能力太弱了,以致如果我不被人鄙视那真的是天理不容啊。从今天开始练习POJ,还是不要忙去做Uva等那些太有名的OJ吧。这次真的是想动真格的了,不然实力提升不上去啊。用Java写,因为我对java实在是太不熟了,主要的参考网站是这个。希望能给我带来好运^_^。从水题开始吧,Let's go.POJ 3299InputInput will consist of a number of lines. Each line except the last will consist of four items separated by spaces: a letter, a numb 阅读全文
posted @ 2012-03-04 21:06 hongxuchen 阅读(256) 评论(0) 推荐(0) 编辑

无觅相关文章插件,快速提升流量