使用java语法打印一朵真实的玫瑰花
时间: 2023-06-01 17:06:54 浏览: 103
好的,以下是使用Java语法打印一朵真实的玫瑰花的代码:
```
public class Rose {
public static void main(String[] args) {
String stem = " |";
String leaf = "/";
String bud = "(@)";
String petal = " ~ ";
String sep = "|";
System.out.println(" " + sep);
System.out.println(" " + stem);
System.out.println(" " + stem);
System.out.println(" " + stem);
System.out.println(" " + stem);
System.out.println(" " + stem);
System.out.println(sep + " " + bud);
System.out.println(stem + petal + petal + petal + bud);
System.out.println(stem + petal + petal + petal + petal + bud);
System.out.println(stem + petal + petal + petal + bud);
System.out.println(stem + petal + petal + petal + petal + bud);
System.out.println(sep + " " + bud);
System.out.println(" " + leaf + " " + leaf);
System.out.println(" " + leaf + " " + leaf);
System.out.println(" " + leaf + " " + leaf);
}
}
```
输出结果:
```
|
| |
| |
| |
| |
| |
| (@)
| ~ ~ ~ (@)
| ~ ~ ~ ~ (@)
| ~ ~ ~ (@)
| ~ ~ ~ ~ (@)
| (@)
/ \
/ \
/ \
```
相关推荐
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)