Describe
Enter an integer n (0<n<2147483647) to print a triangle consisting of "*", as
Input
The first line has an integer n (0<n<2147483647)
Output
"*" composed of triangles
650) this.width=650; "style=" WIDTH:150PX;HEIGHT:197PX; "src=" Http://s2.51cto.com/wyfs02/M02/85/AD/wKiom1er_ Bdsms9-aaadctzv-ho491.png-wh_500x0-wm_3-wmp_4-s_4254989297.png "title=" Sogou 20160811122250.png "border=" 0 "height=" 197 "hspace=" 0 "vspace=" 0 "width=" "alt=" Wkiom1er_bdsms9-aaadctzv-ho491.png-wh_50 "/>
Public class main { public static void main (String[] &NBSP;ARG) { int n = 0; scanner scanner = new scanner (system.in); n = scanner.nextint (); Scanner.close (); for (int i = 1; i <= n; i++) { for (int j = 0; j < n-i; j++) { system.out.print (" "); } for (int p = 0; p < i; p++) { system.out.print ("*"); } System.out.println (); } }}
This article from "Endless life, toss more than" blog, please be sure to keep this source http://admxj.blog.51cto.com/10955090/1836825
Enter an integer n (0<n<2147483647) to print a triangle consisting of "*"