fork download
  1. /*******************************************************************************
  2.  * Aiden Stannard // CS1A // Chapter 5 Homework: Challange 23# // 10/03/2026
  3.  *
  4.  * "+" symbol pattern loop
  5.  *
  6.  * This program outputs the "+" symbol in ten different lines, with each
  7.  * following line adding an additional "+" symbol. After the first 10 lines the
  8.  * prgra
  9.  *
  10.  * Inputs:
  11.  * NO INPUT
  12.  *
  13.  * Output:
  14.  * +
  15.  * ++
  16.  * +++
  17.  * ++++
  18.  * +++++
  19.  * ++++++
  20.  * +++++++
  21.  * ++++++++
  22.  * +++++++++
  23.  * ++++++++++
  24.  * ++++++++++
  25.  * +++++++++
  26.  * ++++++++
  27.  * +++++++
  28.  * ++++++
  29.  * +++++
  30.  * ++++
  31.  * +++
  32.  * ++
  33.  * +
  34.  ******************************************************************************/
  35. #include <iostream>
  36. using namespace std;
  37.  
  38. int main()
  39. {
  40. for (int count = 1; count <= 10; count++)
  41. cout << string(count, '+') << endl;
  42. for (int countTwo = 10; countTwo >= 1; countTwo--)
  43. cout << string(countTwo, '+') << endl;
  44. return 0;
  45. }
Success #stdin #stdout 0.01s 5284KB
stdin
Standard input is empty
stdout
+
++
+++
++++
+++++
++++++
+++++++
++++++++
+++++++++
++++++++++
++++++++++
+++++++++
++++++++
+++++++
++++++
+++++
++++
+++
++
+