Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- import java.nio.file.Files;
- import java.util.ArrayList;
- public class Main {
- public static void main(String[] args) {
- long start = System.nanoTime();
- int MaxWordLength = 64;
- ArrayList<String []> AllWords;
- AllWords = new ArrayList<String[]>();
- byte[] array;
- try {
- array = Files.readAllBytes(new File("O:\\odm.txt").toPath());
- } catch (IOException e) {
- e.printStackTrace();
- }
- /**
- while(true)
- {
- int CharacterRead = 0;
- try {
- CharacterRead = BR.read();
- } catch (IOException e) {
- e.printStackTrace();
- }
- if(CharacterRead == -1)
- break;
- if(CharacterRead >= 'a' && CharacterRead <= 'z')
- {
- if(SB == null)
- SB = new StringBuilder(MaxWordLength);
- SB.append((char) CharacterRead);
- }
- else
- {
- if(SB != null && SB.length() > 0)
- {
- AllWords.add(SB.toString());
- SB = null;
- }
- }
- }*/
- String s = null;
- do {
- try {
- s = BR.readLine();
- } catch (IOException e) {
- e.printStackTrace();
- }
- if (s !=null)
- AllWords.add(s.replaceAll("^[,\\s]+", "").split("[,\\s]+"));
- } while (s !=null);
- try {
- BR.close();
- } catch (IOException e) {
- e.printStackTrace();
- }
- long elapsedTime = System.nanoTime() - start;
- double seconds = (double)elapsedTime / 1000000000.0;
- System.out.println(seconds);
- System.gc();
- BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
- System.out.print("Please enter user name : ");
- String username = null;
- try {
- username = reader.readLine();
- } catch (IOException e) {
- e.printStackTrace();
- }
- System.out.println("You entered : " + username);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement