0

Hi! I'm newbie here. Would you teach me how to make this with c++ program. thank you!

* ** *** **** ***** ****** *** ***

15th Oct 2017, 1:35 AM
Syi fa
2 Réponses
0
Ther are many solutions, especially in C++. The easiest way to do this template, just add to your code a cout Syntax: #include <iostream> int main() { std::cout<<" *\n"; std::cout<<" **\n"; //Follow this shape ;) return 0; } But if you want to make it "automatically", you could also make some Arrays, Loops ... ( and so also arise algorithms ). An easy for-loop example: #include <iostream> using namespace std; int main() { int SetAmount, Space, SomeSymbol; //Loop SetAmount 10 times = 10 rows for(SetAmount = 0; SetAmount <= 10; SetAmount++){ for(Space = 0; Space <= SetAmount; Space++) cout << " "; for(SomeSymbol = 10; SomeSymbol > SetAmount; SomeSymbol--) cout << "*" << endl; } return 0; } That example above is one of many variations. :)
15th Oct 2017, 1:30 PM
avatarluca
avatarluca - avatar
+ 1
@valenzelektron thank you very much ^^
15th Oct 2017, 1:50 PM
Syi fa