daily pastebin goal
68%
SHARE
TWEET

Untitled

a guest Mar 25th, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package zad2;
  2. import java.io.*;
  3.  
  4. public class Tacke {
  5.    
  6.     public static void main(String[] args) throws Exception
  7.     {
  8.         double array[][]=new double[2][2];
  9.         FileReader fr = new FileReader("tacke.txt");
  10.         BufferedReader br = new BufferedReader(fr);
  11.         int i=0;
  12.         try
  13.         {
  14.             String s = "";
  15.             while ((s = br.readLine()) != null)
  16.             {
  17.                 array[0][i]=Double.parseDouble(s.substring(1,s.indexOf(',')));
  18.                 array[1][i++]=Double.parseDouble(s.substring(s.indexOf(',')+1,s.indexOf(')')));
  19.             }
  20.         }
  21.         finally
  22.         {
  23.             br.close();
  24.         }
  25.         for(int j=0;j<i;j++)
  26.         {
  27.             System.out.println(j+1+".  tacka:" );
  28.             System.out.println("x="+array[0][j]+"  y="+array[1][j]);
  29.         }
  30.     }
  31.  
  32. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top