Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /////////////////////////////////////////////////LearnRSU.cpp
- #include <iostream>
- #include "sphere.h"
- using namespace std;
- int main()
- {
- setlocale(LC_ALL, "Russian");
- double R = 0;
- cout << "Величина радиуса: ";
- cin >> R;
- cout << "Длина окружности: " << RToL(R) << endl;
- cout << "Площадь окружности: " << RToS(R) << endl;
- cout << "Площадь поверхности сферы: " << RToSp(R) << endl;
- cout << "Обьем сферы: " << RToV(R) << endl;
- }
- //////////////////////////////////////////////////
- //////////////////////////////////////////////////sphere.cpp
- #include "sphere.h"
- double Pi = 3.14;
- double RToL(int R)
- {
- return 2 * Pi * R;
- }
- double RToS(int R)
- {
- return Pi * R * R;
- }
- double RToSp(int R)
- {
- return 4 * Pi * R * R;
- }
- double RToV(int R)
- {
- return Pi * R * R * R * 1 / 3;
- }
- //////////////////////////////////////////////////
- //////////////////////////////////////////////////sphere.h
- #ifndef SPHERE_H; // или #programa once
- #define SPHERE_H;
- double RToL(int);
- double RToS(int);
- double RToSp(int);
- double RToV(int);
- #endif;
- //////////////////////////////////////////////////
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement