fork download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4.  
  5. class Ideone
  6. {
  7. public static void main (String[] args) throws java.lang.Exception
  8. {
  9. Scanner s=new Scanner(System.in);
  10. int n=s.nextInt();
  11. int a=1,b=1,next;
  12. System.out.print(a+" "+b);
  13. for(int i=2;i<n;i++)
  14. {
  15. next=a+b;
  16. System.out.print(" "+next);
  17. a=b;
  18. b=next;
  19. }
  20. }
  21. }
Runtime error #stdin #stdout #stderr 0.12s 29612KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Exception in thread "main" java.util.NoSuchElementException
	at java.util.Scanner.throwFor(Scanner.java:862)
	at java.util.Scanner.next(Scanner.java:1485)
	at java.util.Scanner.nextInt(Scanner.java:2117)
	at java.util.Scanner.nextInt(Scanner.java:2076)
	at Ideone.main(Main.java:10)