Advertisement
Guest User

Untitled

a guest
Jan 17th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdio>
  3. using namespace std;
  4.  
  5. int szescian(int a) {return a*a*a;}
  6.  
  7. int main()
  8. {
  9. int a;
  10. do
  11. {
  12. cout<<"Wpisz dlugosc boku szescianu:";
  13. cin >> a;
  14. if (a >= 0)
  15. break;
  16. cout<<"Dlugosc boku szescianu nie moze byc mniejsza od zera";
  17.  
  18. }
  19.  
  20. while (a<0);
  21. cout<<"objetosc szescianu wynosi: "<< szescian(a) <<endl;
  22.  
  23. getchar();
  24. cin.get();
  25. return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement