Advertisement
Guest User

Jebac Disa cisa kisa misa tetrisa hisa jddisa na ogul

a guest
Nov 12th, 2019
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.63 KB | None | 0 0
  1.  
  2. package javaapplication2;
  3. import java.io.*;
  4. public class JavaApplication2 {
  5.     public static boolean czypal(String a)
  6.     {
  7.         for (int i=0,j=a.length()-1;i<j;i++,j--)
  8.         {
  9.            if (a.charAt(i)!=a.charAt(j))
  10.                return false;
  11.         }
  12.         return true;
  13.     }
  14.  
  15.     public static void main(String[] args) throws IOException {
  16.       BufferedReader odczyt = new BufferedReader(new FileReader("dane.txt"));
  17.       String linia;
  18.       for (int i=0;i<10;i++)
  19.       {
  20.       linia=odczyt.readLine();
  21.       System.out.println(linia+" "+czypal(linia));
  22.       }
  23.       odczyt.close();
  24.     }
  25.    
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement