Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class A_Mod {
- public static boolean verificar_pal(String str) {
- int i, c;
- c = 0;
- for (i = 0; i < str.length()/2; i++){
- if (str.charAt(i) != str.charAt(str.length()-i-1)){
- return false;
- }
- }
- return true;
- }
- public static void main(String[] args) {
- Scanner ler = new Scanner(System.in);
- int c;
- String str;
- c = 0;
- str = ler.next();
- while (!verificar_pal(str)){
- str = ler.next();
- c++;
- }
- System.out.println(c);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement