Advertisement
Guest User

Untitled

a guest
Oct 4th, 2015
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. package hw03_01;
  2.  
  3. import java.util.*;
  4. import java.io.*;
  5.  
  6. public class Hw03_01 {
  7.  
  8. public static void main(String[] args) throws IOException {
  9. // Testing scanner + variables for the program.
  10.  
  11. Scanner scanner = new Scanner(System.in);
  12.  
  13. FileInputStream input = null;
  14. int i = 0;
  15. int max = i + 1;
  16. int counts = 0;
  17. int READ;
  18. int temp1 = 0;
  19. int temp2 = 0;
  20. int temp3 = 0;
  21. int[] stringArrayTest;
  22. int[] stringArrayCopy = new int [100];
  23. int[] stringArrayFinal = null;
  24.  
  25. // Code to get input from a specified file.
  26.  
  27. try{
  28. input = new FileInputStream("readme.txt");
  29.  
  30. stringArrayTest = new int[100];
  31.  
  32. // While loop to populate string with values.
  33. while((i = input.read()) != -1){
  34. READ = i;
  35.  
  36. stringArrayTest[counts] = READ;
  37.  
  38. System.out.printf("%d,", READ);
  39. System.out.printf(" %c\n",(char) stringArrayTest[counts]);
  40. counts++;
  41. }
  42.  
  43. // Quick test, making sure the values are stored outside the loop.
  44. /* System.out.printf("\t%d, %d, %d", stringArrayTest[0], stringArrayTest[1],
  45. + stringArrayTest[2]); */
  46.  
  47. // Needs to have code that compares and creates the LIS, but I cannot figure
  48. // it out. Seriously, how on earth does it work? I can get all the data I
  49. // need, but I cannot figure out how to actually sort it. Fuck man, I spent
  50. // 6 fucking hours on this to no avail.
  51.  
  52. }finally{
  53. if(input != null)
  54. input.close();
  55. }
  56.  
  57. }
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement