fork download
  1. //Taylor Johnson CS1A Chapter 2, P. 83, #15
  2. //
  3. /******************************************************************************
  4.  *
  5. *Compute a pyramid graphic
  6. *______________________________________________________________________________
  7. * This program will construct an output result of a pyramid made out of
  8. * multiplication symbols
  9. *
  10. * This program is going to be built on syntax laws primaly using strings and \n
  11. * _____________________________________________________________________________
  12. * INPUT
  13. * The required number of *'s in each string aswell as spaces at the
  14. * begining of all rows except the bottom
  15. *
  16. *OUTPUT
  17. * *
  18. * ***
  19. * *****
  20. * *******
  21. ****************************************************************************/
  22.  
  23.  
  24. #include <iostream>
  25. using namespace std;
  26.  
  27. int main()
  28. {
  29. //create a cout function with proper syntax to display a pyramid
  30. cout <<" *\n" << " ***\n" << " *****\n" << "*******" <<endl;
  31. return 0;
  32. }
Success #stdin #stdout 0.01s 5288KB
stdin
Standard input is empty
stdout
   *
  ***
 *****
*******