Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int FactorialNormal(int n){
- int i=1;
- for (int j = n; j >= 1; j--) {
- i=i*j;
- }
- return i;
- }
- int FactorialRecursivo(int n){
- if (n<=1) {
- return 1;
- }else{
- return n*FactorialRecursivo(n-1);
- }
- }
- int Palindromo(String cadena,int inicio,int fin){
- if (inicio<cadena.length()) {
- if (cadena.charAt(inicio)== cadena.charAt(fin)) {
- return 1+Palindromo(cadena,inicio+1,fin-1);
- }
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment