Last active
May 11, 2020 16:00
-
-
Save kryvoboker/43fbfe605b3983b1d6eb3ff5ff2e0bc1 to your computer and use it in GitHub Desktop.
HomeWork4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
/** | |
* | |
* @author kamaz | |
*/ | |
public class Main { | |
public static void main(String [] args) { | |
Scanner sc = new Scanner(System.in); // Первое задание первого уровня | |
int number; | |
System.out.println("Input number"); | |
number = sc.nextInt(); | |
for (int i = 1; i <= number; i++) { | |
if (i == (number - 1)) { | |
break; | |
} | |
for (int j = 1; j <= number; j++) { | |
if (j % 2 == 0) { | |
System.out.print("***"); | |
} | |
else { | |
System.out.print("+++"); | |
} | |
} | |
System.out.println(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment