本帖最后由 华山狙击 于 2014-8-30 20:59 编辑
package practice;
public class Juxing {
public static void main(String[] args) {
Jx(9,2);
}
public static void Jx (int k,int m){
for (int i=1;i<=k;i++){
System.out.print("* "); // _
}
System.out.println();
for (int j=1;j<=m;j++){
System.out.print("*"); // |
for (int l=2;l<k;l++){
System.out.print(" ");
}
System.out.print(" *"); // |
System.out.println();
}
for (int i=1;i<=k;i++){
System.out.print("* "); // _
}
System.out.println();
}
} |