Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Scratch {
- public static void main(String args[]){
- int max = new Scanner(System.in).nextInt();
- if(max == 4 || max == 6 || max == 7){
- System.out.println("not a fibonacci!");
- return;
- }else if(max > 8){
- System.out.println("max is 8 only!");
- return;
- }
- String one = "1";
- String two = "2";
- String three = "3";
- String five = "5";
- String eight = "8";
- if(max == 1){
- two = three = five = eight = " ";
- }else if(max == 2){
- three = five = eight = " ";
- }else if(max == 3){
- five = eight = " ";
- }else if(max == 5){
- eight = " ";
- }
- for(int x = 1; x <= 8; x++){
- for(int y = 1; y <= 13; y++){
- 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 ))));
- }
- System.out.println();
- }
- }
- }
Add Comment
Please, Sign In to add comment