📄 graphics.java
字号:
import java.io.IOException;
public class graphics {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
// TODO Auto-generated method stub
int number = 9 ;
xH(number);
}
public static void xH(int value) throws IOException{
int i = 0 ;
int j = 0 ;
for(j = 0 ; j < value/2 ; j++){
for(int k = 0 ; k < value/2 - j ; k++){
System.out.print(" ");
}
for(i = 0 ; i < 2 *j +1 ; i++){
System.out.print(" " + "*");
}
System.out.println("\n\n");
}
for(j = value/2 ; j >= 0 ; j--){
for(int k = 0 ; k < value/2 - j ; k++){
System.out.print(" ");
}
for(i = 0 ; i < 2 *j +1 ; i++)
System.out.print(" " + "*");
System.out.println("\n\n");
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -