Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int szerokosc, wysokosc, x, y;
  6.  
  7. int main()
  8. {
  9. cout << "Witaj! Podaj szerokosc prostokata."<<endl;
  10. cin >> szerokosc;
  11. cout << "...i wysokosc."<<endl;
  12. cin >> wysokosc;
  13. for(int x=0;x<szerokosc;x++)
  14. {
  15. cout << "O";
  16. }
  17. //wypisanie gornej linii
  18. cout<<endl;
  19. for(int y=0;y<wysokosc;y++)
  20. {
  21. cout<<"O";
  22. for(x=2;x<szerokosc;x++)
  23. {
  24. cout<<" ";
  25. }
  26. cout<<"O"<<endl;
  27. }
  28. //wypisanie linii bocznych
  29. for(int x=0;x<szerokosc;x++)
  30. {
  31. cout << "O";
  32. }
  33. return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement