Jobdu-14-输出梯形 Posted on 2018-06-23 | In Jobdu Question题目描述: 输入一个高度h,输出一个高为h,上底边为h的梯形。 输入:一个整数h(1<=h<=1000)。 输出:h所对应的梯形。 样例输入:4 样例输出: 1234 **** ****** ****************** Answer1234567891011121314151617import java.util.Scanner;public class Main{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); int h = sc.nextInt(); for(int i = 0; i < h; i++){ for(int j = 0; j < 3 * h -2; j++){ if(j < 2*h-2-2*i) System.out.print(" "); else System.out.print("*"); } System.out.print("\n"); } }}