富国沪深
用java语言输出等腰三角形的话一般都是用for语句就行了代码例子给一个你: 如下:/** * 输出各种三角形,菱形,正方形 * @author young * */public class TrianglePrint {// 倒三角public static void p2() {int n = 5;int a = 0;int b = 0;for (int i = n; i >= 1; i--) {if (a != (n - i)) {System.out.print(" ");a++;i = i + 1;} else if (b != (2 * i - 1)) {System.out.print("*");b++;i = i + 1;} else if (a == (n - i) && b == (2 * i - 1)) {System.out.println();a = 0;b = 0;}}}public static void main(String[] args) {p2(); }}