对于**的公式没想到先写了个实现,等我想好*的控制再改个public class ww {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
for (int j=1;j<6;j+=1){
switch (j) {
case 1:
System.out.print("*");
break;
case 2:
System.out.print("**");
break;
case 3:
System.out.print("***");
break;
case 4:
System.out.print("**");
break;
case 5:
System.out.print("*");
break;
default:
break;
}
System.out.println("");
}
}
}