Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //program rysuje prostokat albo kwadrat
- #include<iostream>
- #include<cstdlib>
- using namespace std;
- void dlugosc_boku();
- void wypisanie_figury();
- int main()
- {
- dlugosc_boku();
- system("pause");
- return 0;
- }
- void dlugosc_boku()
- {
- int szerokosc,wysokosc;
- cout<<"podaj dlugos boku a: ";
- cin>>szerokosc;
- cout<<"podaj dlugosc boku b: ";
- cin>>wysokosc;
- cout<<"podales:"<<szerokosc<<" i "<<wysokosc<<endl<<endl;
- for(int i=0 ; i <szerokosc ; i++)
- {
- cout<<"-";
- }
- cout<<endl;
- for(int j =0 ; j <wysokosc; j++)
- {
- cout<<"|";
- for(int z =0 ; z<szerokosc-2; z++)
- cout<<" ";
- cout<<"|"<<endl;
- }
- for(int i=0 ; i <szerokosc ; i++)
- {
- cout<<"-";
- }
- cout<<endl<<endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement