Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <conio.h>
- using namespace std;
- int main()
- {
- int a,i,j,rows;
- cout<<"Czapka ile gwiazdek?: \n";
- cin>>rows;
- cin >> a;
- cin >> a;
- cout<<"\n";
- i=1;
- while(i<=rows){
- j=i;
- while(j<=rows){
- cout<<" ";
- j++;
- }
- j=1;
- while( j<=2*i-1){
- cout<<"*";
- j++;
- }
- j=2*i;
- cout<<"\n";
- i++;
- }
- string tab[20][20];
- for(int i = 0; i < a; i++)
- {
- for(int j = 0; j < a; j++)
- if(j>0&&j<a-1&&i>0&&i<a-1)
- tab [i][j]=" ";
- else
- tab [i][j]="*";
- }
- cout << " ***\n* *\n* *\n ***\n";
- for(int i = 0; i < a; i++)
- {
- cout << endl;
- for(int j = 0; j < a; j++)
- cout << tab[i][j];
- }
- cout << endl;
- for( int j = 1; j <= a - 2; ++j )
- {
- cout << "*" "*";
- cout << " " " ";
- cout << "*" "*"<< endl;
- }
- cout<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement