Skip to content

Instantly share code, notes, and snippets.

@kryvoboker
Created May 8, 2020 21:29
Show Gist options
  • Save kryvoboker/e2aae4cb4ff78c6deeae707a37c7403d to your computer and use it in GitHub Desktop.
Save kryvoboker/e2aae4cb4ff78c6deeae707a37c7403d to your computer and use it in GitHub Desktop.
HomeWork4
import java.util.Scanner;
/**
*
* @author kamaz
*/
public class Main {
public static void main(String [] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
for (int i = 1; i <= a; i++) {
for (int j = 1; j <= b; j++) {
if (j != 1 && i != 1 && j != b && i != a) {
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