Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package biuro;
- import java.io.File;
- import java.io.FileNotFoundException;
- import java.util.Arrays;
- import java.util.Scanner;
- public class Biuro {
- public static void main(String[] args) throws FileNotFoundException {
- File file=new File("C:\\Users\\student\\Desktop\\biuro.txt");
- String text;
- try (Scanner in = new Scanner(file)) {
- text = in.useDelimiter("\\Z").nextLine();
- }
- System.out.println(text);
- System.out.println("________________\nDzielenie:\n");
- String[] biuro = text.split("-");
- System.out.println(Arrays.toString(biuro));
- String nazwa = biuro[0];
- String kond = biuro[1];
- String cena = biuro[2];
- String lokal = biuro[3];
- int kond1 = Integer.parseInt(biuro[1]);
- int cena1 = Integer.parseInt(biuro[2]);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement