Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- public class Rolling
- {
- public static void main (String[] args) throws IOException
- {
- int randomNum;
- PrintWriter fileout = new PrintWriter (new FileWriter ("randumnums.txt"));
- for (int i= 0; i < 101; i++)
- {
- randomNum = (int) (Math.random() * 100);
- fileout.println (randomNum);
- }
- fileout.close();
- }
- }
- import java.io.*;
- public class Reading
- {
- public static void main (String[] args) throws IOException
- {
- BufferedReader readFile = new BufferedReader (new FileReader ("randumnums.txt"));
- int number = 0;
- int inMarks [] = new int [100];
- for (int i = 0; i < 100; i++)
- {
- inMarks [i] = Integer.parseInt(readFile.readLine());
- }
- }
- }
- int inMarks [] = new int [100];
- for (int i = 0; i < 100; i++)
- {
- inMarks [i] = 0;
- }
- String nextLine = null;
- while ((nextLine = readFile.readLine()) != null)
- {
- int thisInt = Integer.parseInt(nextLine);
- inMarks[thisInt] = inMarks[thisInt] + 1;
- }
- import java.io.*;
- public class Reading {
- public static void main (String[] args) throws IOException {
- BufferedReader readFile = new BufferedReader (new FileReader("randumnums.txt"));
- int number = 0;
- int inMarks [] = new int [100];
- String readNumber = "";
- while ((readNumber = readFile.readline()) != null) {
- number = Integer.parseInt(readNumber);
- inMarks[number]++;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement