Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package zad2;
- import java.io.*;
- public class Tacke {
- public static void main(String[] args) throws Exception
- {
- double array[][]=new double[2][2];
- FileReader fr = new FileReader("tacke.txt");
- BufferedReader br = new BufferedReader(fr);
- int i=0;
- try
- {
- String s = "";
- while ((s = br.readLine()) != null)
- {
- array[0][i]=Double.parseDouble(s.substring(1,s.indexOf(',')));
- array[1][i++]=Double.parseDouble(s.substring(s.indexOf(',')+1,s.indexOf(')')));
- }
- }
- finally
- {
- br.close();
- }
- for(int j=0;j<i;j++)
- {
- System.out.println(j+1+". tacka:" );
- System.out.println("x="+array[0][j]+" y="+array[1][j]);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement