Let's look back at C language programming basics. Many of the questions from teachers in the past have been slightly modified. You can input any number of lines to print the christmas tree. The larger the number of lines, the larger the tree, of course, the larger the display, otherwise it will fold.
# Include <stdio. h> printf (scanf (, & (I =; I <= rows; I ++ starNo = I *-spaceNo = I + rows-(j =; j <spaceNo; j ++ printf (, (k =; k <starNo; k ++ printf (, printf (l =; l <; l ++ (m =; m <(rows * +)/; m ++ printf (, printf (,}
In another version, you can enter it multiple times, goto, you know:
# Include <stdio. h> printf (scanf (, & (rows = (I =; I <= rows; I ++ starNo = I *-spaceNo = I + rows-(j =; j <spaceNo; j ++ printf (, (k =; k <starNo; k ++ printf (, printf (l =; l <; l ++ (m =; m <(rows * +)/; m ++ printf (, printf (,}
The compiled exe: STARS.exe, STARS. EXE (revised version)
Development Environment: Turbo C ++ 3.0, learning, simple to use, VC ++ has never been used yet. Who makes C ++ always, haha.