Код: Выделить всё
public class test {
public static void main(String args[]) throws IOException {
BufferedReader pao = new BufferedReader(
new InputStreamReader(System.in));
System.out.print("Enter number: ");
String enter = pao.readLine();
int ent = Integer.parseInt(enter);
int total1 = 0;
int total2 = 1;
int total3 = 0;
for (int a = 0; a < ent; a++) {
if (a
Подробнее здесь: [url]https://stackoverflow.com/questions/26807578/fibonacci-sequence-without-using-array[/url]