Advertisement
dzieciol

pusty prostokąt z gwiazdek

Oct 6th, 2014
563
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.48 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. /* run this program using the console pauser or add your own getch, system("pause") or input loop */
  4. using namespace std;
  5. int main(int argc, char** argv) {
  6.     int a,b,h;
  7.     cout<<"podaj wysokosc "<<endl;
  8.     cin>>h;
  9.     cout<<"szerokosc" <<endl;
  10.     cin>>a;
  11.     for (int i=1;i<=a;i++)
  12.     cout<<"*";
  13.     cout<<endl;
  14.     for (int i=1 ; i<=h ; i++){
  15.         cout<<"*";
  16.         for(int j=1 ; j<=(a-2);j++)
  17.         cout<<" ";
  18.         cout<<"*"<<endl;
  19.     }
  20.     for (int i=1;i<=a ;i++)
  21.     cout<<"*";
  22.    
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement