Commit b6a8bad4 authored by leon.bellerby's avatar leon.bellerby

Actual final commit

parent 2909d5fe
...@@ -3,15 +3,15 @@ import java.util.ArrayList; // import the ArrayList class ...@@ -3,15 +3,15 @@ import java.util.ArrayList; // import the ArrayList class
public class ResitCode { public class ResitCode {
public int Fib_No(int position) { public int Fib_No(int position) {
ArrayList<Integer> list =new ArrayList<Integer>(); ArrayList<Integer> kitlisto =new ArrayList<Integer>();
list.add(0); kitlisto.add(0);
list.add(1); kitlisto.add(1);
for(int i =0; i<position;i++) { for(int i =0; i<position;i++) {
list.add(list.get(list.size()-1)+list.get(list.size()-2)); kitlisto.add(kitlisto.get(kitlisto.size()-1)+kitlisto.get(kitlisto.size()-2));
} }
return list.get(position-1); return kitlisto.get(position-1);
} }
public String pigLatin(String message) public String pigLatin(String message)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment