Advertisement
HyperSensualNarwhal

Different triangles

Dec 8th, 2016
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.59 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using std::cout;
  4. using std::cin;
  5. using std::endl;
  6.  
  7.  
  8. void main()
  9. {
  10.     setlocale(LC_ALL, "Russian");
  11.  
  12.  
  13.  
  14.  
  15. /*
  16.  
  17.     *
  18.    * *
  19.   * * *
  20.  * * * *
  21. * * * * *
  22.  
  23.     for (int i = 5; i >= 0; i--)
  24.     {
  25.  
  26.         for (int j = 0; j <= 5; j++)
  27.         {
  28.             if (j <= i) cout << " "; else cout << "*";
  29.             if (j > i) cout << " ";
  30.         }
  31.  
  32.         cout << endl;
  33.     }
  34.  
  35. */
  36.  
  37.  
  38.  
  39.  
  40. /*
  41.  
  42. * * * * *
  43.  * * * *
  44.   * * *
  45.    * *
  46.     *
  47.  
  48.     for (int i = 0; i <= 4; i++)
  49.     {
  50.  
  51.         for (int j = 0; j <= 5; j++)
  52.         {
  53.             if (j <= i) cout << " "; else cout << "*";
  54.             if (j > i) cout << " ";
  55.         }
  56.  
  57.         cout << endl;
  58.     }
  59.    
  60. */
  61.  
  62.  
  63.  
  64.  
  65. /*
  66.  
  67. *
  68.  *
  69.   *
  70.  *
  71. *
  72.  
  73.     int size, k = 0;
  74.  
  75.     cout << "Введите размер: "; cin >> size;
  76.     for (int i = 0; i <= size; i++)
  77.     {
  78.  
  79.     for (int j = 0; j <= k; j++)
  80.     {
  81.     if (j < k) cout << " "; else cout << "*";
  82.     }
  83.  
  84.     if (i < (size / 2)) k++; else k--;
  85.     cout << endl;
  86.     }
  87.    
  88. */
  89.  
  90.  
  91.  
  92.  
  93. /*
  94.  
  95. *
  96. * *
  97. * * *
  98. * *
  99. *
  100.  
  101.     int size, k = 0;
  102.  
  103.     cout << "Введите размер: "; cin >> size;
  104.     for (int i = 0; i <= size; i++)
  105.     {
  106.     for (int j = 0; j <= k; j++)
  107.     {
  108.     if (k < j) cout << "#"; else cout << "*";
  109.     }
  110.  
  111.     if (i < (size / 2)) k++; else k--;
  112.     cout << endl;
  113.     }
  114.  
  115. */
  116.  
  117.  
  118.  
  119.  
  120. /*
  121.  
  122. * * * * *
  123. * * * *
  124. * * *
  125. * *
  126. *
  127.    
  128.     for (int i = 5; i > 0; i--)
  129.     {
  130.  
  131.     for (int j = 0; j < i; j++)
  132.     cout << '*' << " ";
  133.  
  134.     cout << endl;
  135.     }
  136.  
  137. */
  138.  
  139.  
  140.  
  141.  
  142. /*
  143.  
  144. * * * * *
  145.   * * * *
  146.     * * *
  147.       * *
  148.         *
  149.  
  150.    
  151.     for (int i = 0; i < 5; i++)
  152.     {
  153.  
  154.     for (int j = 0; j < 5; j++)
  155.     {
  156.     if (j < i) cout << " "; else cout << "*";
  157.     cout << " ";
  158.     }
  159.     cout << endl;
  160.    
  161.     }
  162.  
  163. */
  164.  
  165.  
  166.  
  167.  
  168. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement