Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- #define PI 3.14
- class Kolo {
- private:
- double promien;
- public:
- Kolo(double r) : promien(r) {
- }
- void print() {
- cout <<"Promien: "<<promien<<endl;
- }
- double pole() {
- return PI*promien*promien;
- }
- double obwod() {
- return 2*PI*promien;
- }
- };
- int main(int argc, char **argv) {
- Kolo k1 (5);
- k1.print();
- cout<<"Pole: "<<k1.pole()<<", obwod:"<<k1.obwod()<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement