Advertisement
HyperSensualNarwhal

Rhombus by slashes

Nov 25th, 2016
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.87 KB | None | 0 0
  1. // 2D Ramiel ;(
  2.  
  3. #include <iostream>
  4.  
  5. using std::cout;
  6. using std::cin;
  7. using std::endl;
  8.  
  9. void main()
  10. {
  11.     setlocale(LC_ALL, "Russian");
  12.  
  13.     int a;
  14.     char ch = '*';
  15.  
  16.     char fs = '/', bs = '\\';
  17.  
  18.     cout << "Введите размер фигуры: "; cin >> a;
  19.     cout << endl;
  20.  
  21.  
  22.     for (int i = 0; i <= a-1; i++)
  23.     {
  24.         for (int j = a-1; j >= i; j--)
  25.         {
  26.         cout << " ";
  27.         }
  28.  
  29.         cout << fs;
  30.  
  31.         for (int j = 0; j <= i - 1; j++)
  32.         {  
  33.             cout << " ";   
  34.         }
  35.  
  36.         for (int j = 0; j <= i - 1; j++)
  37.         {
  38.             cout << " ";
  39.         }
  40.  
  41.         cout << bs;
  42.  
  43.         cout << endl;
  44.     }
  45.  
  46.    
  47.     for (int i = a-1; i >= 0; i--)
  48.     {
  49.  
  50.         for (int j = a-1; j >= i; j--)
  51.         {
  52.             cout << " ";
  53.         }
  54.  
  55.         cout << bs;
  56.  
  57.         for (int j = 0; j <= i - 1; j++)
  58.         {
  59.             cout << " ";
  60.         }
  61.    
  62.         for (int j = 0; j <= i - 1; j++)
  63.         {
  64.             cout << " ";
  65.         }
  66.  
  67.         cout << fs;
  68.  
  69.         cout << endl;
  70.  
  71.     }
  72.  
  73.     cout << endl;
  74. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement