Advertisement
Guest User

całe te

a guest
Dec 12th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.99 KB | None | 0 0
  1. #include <iostream>
  2. #include <conio.h>
  3. using namespace std;
  4. int main()
  5. {
  6.     int a,i,j,rows;
  7.     cout<<"Czapka ile gwiazdek?: \n";
  8.     cin>>rows;
  9.     cin >> a;
  10.     cin >> a;
  11.     cout<<"\n";
  12.     i=1;
  13. while(i<=rows){
  14.     j=i;
  15.   while(j<=rows){
  16.    cout<<" ";
  17.   j++;
  18.   }
  19.   j=1;
  20.   while( j<=2*i-1){
  21.    cout<<"*";
  22.    j++;
  23.   }
  24.   j=2*i;
  25.    cout<<"\n";
  26. i++;
  27. }
  28.         string tab[20][20];
  29.         for(int i = 0; i < a; i++)
  30.         {
  31.            for(int j = 0; j < a; j++)
  32.               if(j>0&&j<a-1&&i>0&&i<a-1)
  33.                   tab [i][j]=" ";
  34.               else
  35.                   tab [i][j]="*";
  36.         }
  37. cout << " ***\n*   *\n*   *\n ***\n";
  38. for(int i = 0; i < a; i++)
  39.         {
  40.             cout << endl;
  41.             for(int j = 0; j < a; j++)
  42.                cout << tab[i][j];
  43.         }
  44.     cout << endl;
  45.     for( int j = 1; j <= a - 2; ++j )
  46.     {
  47.         cout << "*" "*";
  48.         cout << " " " ";
  49.         cout << "*" "*"<< endl;
  50.     }
  51. cout<<endl;
  52.     return 0;
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement