import java.io.*;
import java.util.*;
public class Ex13Class {
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		String fileOut = "score.txt";
		Random random = new Random();
		try
		{
			//Out
			FileWriter writer = new FileWriter(fileOut);
			PrintWriter pw = new PrintWriter(writer);
			for (int i=0; i< 100; i++)
			{
				int a = random.nextInt();
				if (a < 0)
					a = -a;
				int b = a % 90 + 10;
				System.out.printf("%2d\n",b);
				        pw.printf("%2d",b);pw.println();
			}
			pw.close();
		}
		catch(FileNotFoundException fe)
		{
			System.out.printf(fe.getMessage());
		}
		catch(IOException ie)
		{
			System.out.printf(ie.getMessage());
		}
	}
}

bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark

Tags: , , ,

This entry was posted on 星期二, 五月 27th, 2014 at 09:06:00 and is filed under 102(下)程式設計(二). 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.

11 Trackbacks/Pings

  1. Frederick    七月 03 2014 / 7上午:

    watsons@squares.hopeful” rel=”nofollow”>.…

    thanks for information!!…

  2. Zachary    七月 29 2014 / 10上午:

    saxton@nicer.anacondas” rel=”nofollow”>.…

    ñïñ!!…

  3. leslie    八月 24 2014 / 11上午:

    offerings@yellow.foot” rel=”nofollow”>.…

    tnx for info….

  4. Bryan    十一月 17 2014 / 2下午:

    insomniacs@processing.chahar” rel=”nofollow”>.…

    good info!…

  5. Anthony    十二月 09 2014 / 1上午:

    wealth@adjourns.entire” rel=”nofollow”>.…

    tnx for info….

  6. brett    一月 27 2015 / 8上午:

    jure@grenier.impelled” rel=”nofollow”>.…

    good!…

  7. Darryl    一月 30 2015 / 12下午:

    takeover@midwood.tranquillity” rel=”nofollow”>.…

    thanks….

  8. Antonio    一月 30 2015 / 12下午:

    tigress@blackout.alertly” rel=”nofollow”>.…

    tnx for info!…

  9. Lloyd    一月 30 2015 / 1下午:

    ugh@hooliganism.yelp” rel=”nofollow”>.…

    ñïñ….

  10. Peter    一月 30 2015 / 1下午:

    hord@rewriting.caliche” rel=”nofollow”>.…

    tnx for info!!…

  11. Joshua    二月 09 2015 / 7下午:

    revenues@democratique.exultantly” rel=”nofollow”>.…

    ñïñ!…

Leave a reply

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