Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package fibonachi;
- import org.junit.Test;
- public class fibo {
- @Test
- public void test()
- {
- System.out.println(fibo(1, 1, 40));
- }
- public static int fibo(int getal1, int getal2, int a) {
- System.out.println(getal1);
- if(a > 0)
- {
- int getal = getal1 + getal2;
- return fibo(getal2, getal, a-1);
- }
- return getal1;
- }
- }
- import junit.framework.JUnit4TestAdapter;
- public class main {
- public static junit.framework.Test suite() {
- return new JUnit4TestAdapter( fibo.class );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement