Guest User

Untitled

a guest
Jun 25th, 2018
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. int FactorialNormal(int n){
  2. int i=1;
  3. for (int j = n; j >= 1; j--) {
  4. i=i*j;
  5. }
  6.  
  7. return i;
  8.  
  9. }
  10. int FactorialRecursivo(int n){
  11. if (n<=1) {
  12. return 1;
  13. }else{
  14. return n*FactorialRecursivo(n-1);
  15. }
  16.  
  17. }
  18. int Palindromo(String cadena,int inicio,int fin){
  19. if (inicio<cadena.length()) {
  20. if (cadena.charAt(inicio)== cadena.charAt(fin)) {
  21. return 1+Palindromo(cadena,inicio+1,fin-1);
  22. }
  23. }
  24. return 0;
  25. }
Add Comment
Please, Sign In to add comment