Java 实例 – 打印倒立的三角形
Java 教程
· 2019-02-10 19:13:13
打印倒立的三角形。
实例
public class InvertedTriangle {
public static void main(String[] args) {
//打印倒立的三角形
for (int m = 1; m <= 4; m++) {
//打印空格
for (int n = 0; n <= m; n++) {
System.out.print(" ");
}
//打印*
for (int x = 1; x <= 7 -2 * (m - 1); x++) {
System.out.print("*");
}
System.out.println();
}
}
}
输出结果:
*******
*****
***
*
点击查看所有 Java 教程 文章: https://www.codercto.com/courses/l/12.html
Java Message Service API Tutorial and Reference
Hapner, Mark; Burridge, Rich; Sharma, Rahul / 2002-2 / $ 56.49
Java Message Service (JMS) represents a powerful solution for communicating between Java enterprise applications, software components, and legacy systems. In this authoritative tutorial and comprehens......一起来看看 《Java Message Service API Tutorial and Reference》 这本书的介绍吧!