willieshi232

Untitled

Mar 9th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.36 KB | None | 0 0
  1. import java.util.*;
  2. import java.io.*;
  3. public class Bob {
  4. public static void main(String[] args) {}
  5.  
  6. public int RangeBetweenZeroes(ArrayList<int> Breloom)
  7. throws FileNotFoundException {
  8. Scanner list = new Scanner(new File("C:\\Users\\WillieShi\\IdeaProjects\\JavaClassFunTime\\src\\com\\suarezJava\\pookachu"));
  9. while (list.hasNextInt()) {
  10. int snowrunt = list.nextInt();
  11. Breloom.add(snowrunt);
  12. }
  13. int closest0 = -1;
  14. int farthest0 = -1;
  15. for (int i == 0; i <breloom.size (); i++)
  16. {
  17. int temp = get(i);
  18. if (temp == 0 && i > closet0) {
  19. closet0 = i;
  20. }
  21. if (temp == 0 && i < closet0) {
  22. farthest0 = i;
  23. }
  24. }
  25. int range = farthest0 - closest0 + 1;
  26. if (closet0 == -1 && farthest0 == -1) {
  27. return 0;
  28. }
  29. if (closet0 < -1 && farthest0 == -1) {
  30. return 1;
  31. }
  32.  
  33. return range;
  34.  
  35. }
  36. }
  37. public void removeInRange(ArrayList<String> snowrunt,String beg, String end)
  38. {
  39. Char begchar = beg.charAt(0);
  40. Char endchar = end.charAt(0);
  41. Scanner list = new Scanner(new File("C:\\Users\\WillieShi\\IdeaProjects\\JavaClassFunTime\\src\\com\\suarezJava\\pookachu"));
  42. while(list.hasNextString)
  43. {
  44. int frostlass = list.nextString;
  45. snowrunt.add(frostlass);
  46. }
  47. char[] torchick = {a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z};
  48. Int begcharfinal = 0;
  49. Int endcharfinal = 0;
  50. Int tempFinal = 0;
  51. for(int i = 0; i < torchik.length; i++)
  52. {
  53. if(begchar == torchick(i))
  54. {
  55. begcharfinal = i
  56. }
  57. if(endchar = torchick(i))
  58. {
  59. endcharfinal = i;
  60. }
  61. }
  62. for(int x = 0; x < snowrunt.size(); x++)
  63. {
  64. char temp = snowrunt(i).charAt(0);
  65. for(int z = 0; i < torchik.length; z++)
  66. {
  67. if(temp == torchik(i))
  68. {
  69. tempFinal = i;
  70. }
  71. }
  72. if (begcharfinal < tempFinal && endcharfinal > tempFinal )
  73. {
  74. snowrunt.remove(i);
  75. }
  76. }
Add Comment
Please, Sign In to add comment