• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content

Loading…

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

Like this presentation? Why not share!

Palíndromo.ppt

on

  • 1,791 views

 

Statistics

Views

Total Views
1,791
Views on SlideShare
1,757
Embed Views
34

Actions

Likes
0
Downloads
14
Comments
0

4 Embeds 34

http://reggioblog.blogspot.com 27
http://reggioblog.blogspot.com.es 5
http://reggioblog.blogspot.com.ar 1
http://reggioblog.blogspot.mx 1

Accessibility

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

     Palíndromo.ppt Palíndromo.ppt Presentation Transcript

    •  
    • ¿Que es?
      • Es una palabra, frase o numero que se lee igual hacia adelante que hacia atrás. Si se trata de un número se llama capicúa.
      • De una letra
      • a
      • e
      • De dos letras
      • Aa
      • De tres letras
      • acá
      • agá
      • ala
      • ama
      • De cuatro letras
      • erre
      • allá
      • De cinco letras
      • aboba
      • aérea
      • De seis letras
      • narran
      • rallar
      • De siete letras
      • abanaba
      • Anilina
      • De ocho letras
      • Acurruca
      • De nueve letras
      • reconocer Frases
      • A la patata, tápala.
      • Adán salta y Atlas nada
      Palíndromos
      • import java.util.*; import java.io.*; public class palindrome { static boolean isPalindrome(String palabra) { StringBuffer aux = new StringBuffer(palabra).reverse(); return palabra.equals(aux.toString()); } public static void main(String args[]) { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); System.out.print("Introduce una palabra: "); String palabra = null; try { palabra = in.readLine();} catch (Exception e) {} if(isPalindrome(palabra)) System.out.println(palabra + " es palindroma"); else System.out.println(palabra + " no es palindroma"); } }
      CÓDIGO ITERATIVO
    • p r o g r a m a c i o n n o i c a m a r g o r p A n i t a l a v a l a t i n a a n i t a l a v a l a t i n A EJEJEMPLO DEL CÓDIGO ITERATIVO
      • <html> <title>Palindromo</title> <head>Comprobar si una cadena es palindromo o no</head> <body> <script type=&quot;text/javascript&quot;> function palindromo(cadena){ if(cadena.length==0 || cadena.length ==1) return true; else { var respuesta=cadena.substring(1,cadena.length-1); return cadena[0]==cadena[cadena.length-1] && palindromo(respuesta);      } }   var cadena=prompt(&quot;Ingrese la cadena:&quot;); cadena=cadena.replace(/ /g, ''); cadena=cadena.toUpperCase(); var res=palindromo(cadena); if(res==true){ alert(&quot;Si es palindromo&quot;); } else{ alert(&quot;No es palindromo&quot;); } </script> </body> </html>
      CÓDIGO RECURSIVO
    •