Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdio>
- using namespace std;
- int szescian(int a) {return a*a*a;}
- int main()
- {
- int a;
- do
- {
- cout<<"Wpisz dlugosc boku szescianu:";
- cin >> a;
- if (a >= 0)
- break;
- cout<<"Dlugosc boku szescianu nie moze byc mniejsza od zera";
- }
- while (a<0);
- cout<<"objetosc szescianu wynosi: "<< szescian(a) <<endl;
- getchar();
- cin.get();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement