Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package recursividade;
- import java.util.Stack;
- public class recursivo {
- public static void main(String[] args) {
- String palavra = "ADA";
- System.out.println(palindrome(palavra));
- }
- public static int fatorial(int num) {
- if(num == 0) {
- return 1;
- }
- return num * fatorial(num - 1);
- }
- public static int powerN(int base, int expoente) {
- if(expoente == 0) {
- return 1;
- }else {
- return base * powerN(base, expoente -1);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement