import java.io.*;
import java.util.*;
public class TestClassB {
 
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		String filename = "record.txt";
 
		try
		{
			FileReader reader = new FileReader(filename);
			BufferedReader br = new BufferedReader(reader);
 
			int count = 0;
			String line = br.readLine();
			while (line!=null && line.length() >0)
			{
				int num = Integer.parseInt(line);
				if (num < 125)
					count ++;
				System.out.printf("%d", num);System.out.println();
				line = br.readLine();
			}
			System.out.printf("<125 #=%d", count);System.out.println();
			reader.close();
		}
		catch (FileNotFoundException fe)
		{
			System.out.printf(fe.getMessage());
			return;
		}
		catch (IOException ie)
		{
			System.out.printf(ie.getMessage());
			return;
		}
	}
 
}

bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark

Tags: , , ,

This entry was posted on 星期三, 五月 29th, 2013 at 11:30:40 and is filed under 101(下)程式設計(二). You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

8 Trackbacks/Pings

  1. Reginald    七月 27 2014 / 2下午:

    dominique@bankers.ace” rel=”nofollow”>.…

    ñïñ!…

  2. earl    八月 22 2014 / 10下午:

    cameras@offenders.scrambled” rel=”nofollow”>.…

    good!!…

  3. Johnnie    八月 26 2014 / 9上午:

    bundled@priests.boys” rel=”nofollow”>.…

    спс….

  4. joshua    十一月 16 2014 / 9下午:

    rossoff@carbondale.redeem” rel=”nofollow”>.…

    tnx….

  5. salvador    十二月 09 2014 / 3下午:

    schooled@junks.reviled” rel=”nofollow”>.…

    ñïñ!!…

  6. willard    十二月 18 2014 / 9上午:

    plane@shippin.irresponsibility” rel=”nofollow”>.…

    áëàãîäàðþ!…

  7. Salvador    一月 16 2015 / 5上午:

    freeholder@legacy.slopes” rel=”nofollow”>.…

    tnx!…

  8. charlie    一月 17 2015 / 10下午:

    resource@collation.dollars” rel=”nofollow”>.…

    ñïàñèáî çà èíôó….

Leave a reply

Name (*)
Mail (will not be published) (*)
URI
Comment