Advertisement
476179

Untitled

Feb 27th, 2020
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. import java.io.*;
  2. import java.util.Scanner;
  3. public class FreeShirts
  4. {
  5. public static void main(String[] args) throws IOException //throw-n provides exception if file not found
  6. {
  7.  
  8. //open file for reading, must create file object first
  9. File file = new File("C:\\Users\\mitcpale842\\Desktop\\ECOO_fileReading\\DATA11.txt");
  10. // on windows must use two backslashes
  11.  
  12. Scanner inputFile = new Scanner(file);
  13. int b=0,a=0,v=0;
  14. while (inputFile.hasNext())
  15. {
  16.  
  17. a = inputFile.nextInt();
  18. b = inputFile.nextInt();
  19. v = inputFile.nextInt();
  20.  
  21. inputFile.nextLine();
  22. String sentence = inputFile.nextLine();
  23. String[] myStringArray = sentence.split(" ");
  24. for(int i = 0; i < D; i++)
  25. {
  26. N--;
  27. for(int x = 0; x < a1.length; x++)
  28. {
  29. N++;
  30. }
  31. if(n == 0)
  32. {
  33. int wash++;
  34. }
  35. }
  36.  
  37.  
  38. }
  39.  
  40.  
  41.  
  42. inputFile.close();
  43.  
  44. }
  45.  
  46.  
  47.  
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement