Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
separando o codigo do fatorial recursivo
  • Loading branch information
viniciusbds committed Aug 7, 2018
commit 359b48a6cfe4e32e2fadcfa25bd3124d2cf4cbef
8 changes: 0 additions & 8 deletions Java/Fatorial.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,9 @@
public class Fatorial {

public static void main(String [] args){
System.out.println("Fatorial Recursivo de 7 : " + FatorialRecursivo(7) );
System.out.println("Fatorial de 7 : " + Fatorial(7) );
}

public static int FatorialRecursivo(int x){
if(x == 1)
return 1;
else
return x * FatorialRecursivo(x-1);
}

public static int Fatorial(int x){
int total = 1;
for (int i = 2; i < x+1; i++) {
Expand Down
13 changes: 13 additions & 0 deletions Java/FatorialRecursiva.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
public class FatorialRecursiva {

public static void main(String [] args){
System.out.println("Fatorial de 7 : " + Fatorial(7) );
}

public static int Fatorial(int x){
if(x == 1)
return 1;
else
return x * Fatorial(x-1);
}
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Algoritmos em C/C++, Java, Python, Go e Ruby desenvolvidos como estudo de Algori
| 13 | [Exponenciação][13] | C/C++ | Java | [Python](/Python/Exponenciacao.py) | [Go](/GoLang/exponenciacao/exponenciacao.go) | [Ruby](/Ruby/Exponenciacao.rb) |
| 14 | [Exponenciação Recursiva][14] | C/C++ | Java | [Python](/Python/ExponenciacaoRecursiva.py) | Go | [Ruby](/Ruby/ExponenciacaoRecursiva.rb) |
| 15 | [Fatorial][15] | [C/C++](/C/Fatorial.c) | [Java](/Java/Fatorial.java) | [Python](/Python/Fatorial.py) | [Go](/GoLang/fatorial/fatorial.go) | [Ruby](/Ruby/Fatorial.rb) |
| 16 | [Fatorial Recursiva][16] | C/C++ | Java | [Python](/Python/FatorialRecursiva.py) | Go | [Ruby](/Ruby/Fatorial.rb) |
| 16 | [Fatorial Recursiva][16] | C/C++ | [Java](/Java/FatorialRecursiva.java) | [Python](/Python/FatorialRecursiva.py) | Go | [Ruby](/Ruby/Fatorial.rb) |
| 17 | [Fibonacci][17] | C/C++ | [Java](/Java/Fibonacci.java) | [Python](/Python/Fibonacci.py) | [Go](/GoLang/fibonacci/fibonacci.go) | [Ruby](/Ruby/Fibonacci.rb) |
| 18 | [Fila][18] | [C/C++](/C/Fila.c) | [Java](/Java/Fila.java) | [Python](/Python/Fila.py) | Go | [Ruby](/Ruby/Fila.rb) |
| 19 | [Fila Encadeada Dinâmica][19] | [C/C++](/C/FilaEncadeadaDinamica.c) | Java | Python | Go | Ruby |
Expand Down