Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <math.h>
- #include <stdlib.h>
- #include <iostream>
- using namespace std;
- double* ellips(int a, int b)
- {
- double S, L;
- const double Pi = 3.14159;
- S = Pi * a * b;
- L = 2 * Pi * pow((1 / 2 * (pow(a, 2) + pow(b, 2))), (1 / 2));
- double* mas = new double [2];
- mas [0] = S;
- mas [1] = L;
- return mas;
- }
- int main()
- {
- double a, b;
- cout << "a=";
- cin >> a;
- cout << "\nb=";
- cin >> b;
- double* ptr;
- ptr = ellips(a, b);
- cout << "S=" << ptr[0];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement