└── Hallow sphere /Hallow sphere: -------------------------------------------------------------------------------- 1 | import java.util.*; 2 | public class Main 3 | { 4 | public static void main(String[] args) { 5 | Scanner Sc=new Scanner(System.in); 6 | int i,j; 7 | int n=Sc.nextInt(); 8 | int m=Sc.nextInt(); 9 | for(i=1;i<=n;i++){ 10 | for(j=1;j<=m;j++){ 11 | if(i==n||i==1||j==1||j==m) 12 | { 13 | System.out.print("*"); 14 | } 15 | else{ 16 | System.out.print(" "); 17 | } 18 | } 19 | System.out.println(); 20 | } 21 | } 22 | } 23 | 24 | --------------------------------------------------------------------------------