随笔分类 -  ACM

JAVA重定向输入输出
摘要:没什么好说的,直接贴代码了。 1 import java.io.*; 2 import java.util.*; 3 4 public class Main { 5 public static void main(String[] args) throws IOException { 6 System.setIn(new BufferedInputStream(new FileInputStream("ride.in"))); 7 System.setOut(new PrintStream(new FileOutputStream("ride.out". 阅读全文

posted @ 2012-11-26 16:31 leohxj 阅读(2630) 评论(1) 推荐(0)

HDU 2.1.2
摘要:/** * Author: Leo Hui * Last modified: 2012-03-28 22:16 * Filename: 22.c * Description: prime number */#include <stdio.h>#include <math.h>int isPrime(int n);int main(){ int n, sum; while (scanf("%d", &n) != EOF) { sum = 0; while (n--) { int a; scanf("%d", &a); 阅读全文

posted @ 2012-03-28 23:19 leohxj 阅读(194) 评论(0) 推荐(0)

导航