Advertisement
Guest User

Untitled

a guest
Feb 19th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. >2.0 5.0 3.5
  2. >
  3. >5.2 0.5 4.8
  4. >
  5. >1.0
  6. >
  7. >2.5
  8.  
  9. import java.io.*;
  10.  
  11. public class MainProg{
  12. public static void main(String[] args) throws IOException{
  13. FileReader fr = new FileReader("info.txt");
  14. BufferedReader br = new BufferedReader(fr);
  15. String nums;
  16. int count =0;
  17. int lineNo = 0;
  18.  
  19.  
  20. while((nums = br.readLine()) != null){
  21. String numbers[] = nums.split(" ");
  22. double[][] ball = new double[lineNo][];
  23. if(numbers.length == 3){
  24. for(int i = 0; i < numbers.length; i++){
  25. double[][] box = new double[lineNo][i];
  26. box[lineNo][i] = Double.parseDouble(numbers[lineNo]);
  27.  
  28. lineNo++;
  29.  
  30. System.out.println(box[i] + " ");
  31. }
  32. }else{
  33. while(numbers.length == 1 && ((nums = br.readLine()) != null)){
  34. int p = 0;
  35. ball[count][p] = Double.parseDouble(numbers[count]);
  36. p++;
  37. count++;
  38. }
  39. }
  40. }
  41. }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement