Advertisement
Guest User

Untitled

a guest
Mar 17th, 2018
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.97 KB | None | 0 0
  1. package ru.pa4ok.it1;
  2.  
  3. import java.io.BufferedReader;
  4. import java.io.File;
  5. import java.io.FileReader;
  6. import java.io.IOException;
  7.  
  8. public class it1
  9. {
  10.     private static char[][] ch;
  11.     private static int kol = 0;
  12.    
  13.     public static void main(String[] args)
  14.     {
  15.         BufferedReader reader = null;
  16.         try
  17.         {
  18.             reader = new BufferedReader(new FileReader(new File("C://it/it1/s1.txt")));
  19.             String c;
  20.            
  21.             while ((c = reader.readLine()) != null)
  22.             {
  23.                 ch[kol] = c.toCharArray();
  24.                 kol = kol + 1;
  25.             }
  26.            
  27.             reader.close();
  28.         }
  29.         catch (IOException e)
  30.         {
  31.             e.printStackTrace();
  32.         }
  33.        
  34.         for (int i=0; i<ch.length; i++)
  35.         {
  36.             for (int j=0; j<ch[i].length; j++)
  37.             {
  38.                 System.out.print(ch[i][j] + " ");
  39.             }
  40.             System.out.println();
  41.         }
  42.     }
  43.  
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement