Guest User

Untitled

a guest
Oct 21st, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class Scratch {
  3. public static void main(String args[]){
  4. int max = new Scanner(System.in).nextInt();
  5. if(max == 4 || max == 6 || max == 7){
  6. System.out.println("not a fibonacci!");
  7. return;
  8. }else if(max > 8){
  9. System.out.println("max is 8 only!");
  10. return;
  11. }
  12.  
  13. String one = "1";
  14. String two = "2";
  15. String three = "3";
  16. String five = "5";
  17. String eight = "8";
  18. if(max == 1){
  19. two = three = five = eight = " ";
  20. }else if(max == 2){
  21. three = five = eight = " ";
  22. }else if(max == 3){
  23. five = eight = " ";
  24. }else if(max == 5){
  25. eight = " ";
  26. }
  27.  
  28. for(int x = 1; x <= 8; x++){
  29. for(int y = 1; y <= 13; y++){
  30. System.out.print(x <= 3 && y <= 3 ? three : (x > 3 && x <= 8 ? (y <= 5 ? five : eight) : (y > 5 && y <= 13 ? eight : (x <= 2 && y <= 5 ? two : one ))));
  31. }
  32. System.out.println();
  33. }
  34. }
  35. }
Add Comment
Please, Sign In to add comment