Skip to main content
Proper code block with fixed indent
Source Link
otus
  • 5.7k
  • 1
  • 38
  • 51

public static void main(String[] args) { Scanner input = new Scanner(System.in); int number = input.nextInt(); long a = 0; long b = 1; for(int i = 1; i<number;i++){ long c = a +b; a=b; b=c; System.out.println(c); } } }

//i I think this is a simple way//:

public static void main(String[] args) { Scanner input = new Scanner(System.in); int number = input.nextInt(); long a = 0; long b = 1; for(int i = 1; i<number;i++){ long c = a +b; a=b; b=c; System.out.println(c); } } } 

public static void main(String[] args) { Scanner input = new Scanner(System.in); int number = input.nextInt(); long a = 0; long b = 1; for(int i = 1; i<number;i++){ long c = a +b; a=b; b=c; System.out.println(c); } } }

//i think this is simple way//

I think this is a simple way:

public static void main(String[] args) { Scanner input = new Scanner(System.in); int number = input.nextInt(); long a = 0; long b = 1; for(int i = 1; i<number;i++){ long c = a +b; a=b; b=c; System.out.println(c); } } } 
Source Link

public static void main(String[] args) { Scanner input = new Scanner(System.in); int number = input.nextInt(); long a = 0; long b = 1; for(int i = 1; i<number;i++){ long c = a +b; a=b; b=c; System.out.println(c); } } }

//i think this is simple way//