Advertisement
Guest User

Untitled

a guest
Nov 27th, 2014
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.76 KB | None | 0 0
  1. //program rysuje prostokat albo kwadrat
  2. #include<iostream>
  3. #include<cstdlib>
  4. using namespace std;
  5.  
  6. void dlugosc_boku();
  7. void wypisanie_figury();
  8.  
  9. int main()
  10. {
  11.  
  12.     dlugosc_boku();
  13.    
  14.  
  15.  
  16.     system("pause");
  17.     return 0;
  18. }
  19.  
  20.  
  21.  
  22. void dlugosc_boku()
  23. {
  24.     int szerokosc,wysokosc;
  25.    
  26.     cout<<"podaj dlugos boku a: ";
  27.     cin>>szerokosc;
  28.     cout<<"podaj dlugosc boku b: ";
  29.     cin>>wysokosc;
  30.    
  31.     cout<<"podales:"<<szerokosc<<" i "<<wysokosc<<endl<<endl;
  32.    
  33.    
  34.    
  35.     for(int i=0 ; i <szerokosc ; i++)
  36.         {
  37.             cout<<"-";
  38.         }
  39.         cout<<endl;
  40.         for(int j =0 ; j <wysokosc; j++)
  41.             {
  42.                 cout<<"|";
  43.                 for(int z =0 ; z<szerokosc-2; z++)
  44.                 cout<<" ";
  45.                 cout<<"|"<<endl;
  46.            
  47.            
  48.             }
  49.     for(int i=0 ; i <szerokosc ; i++)
  50.         {
  51.             cout<<"-";
  52.         }
  53.        
  54.     cout<<endl<<endl;
  55.        
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement