@hwmlex
41 / 41 / 3
Регистрация: 30.01.2013
Сообщений: 133
|
22.11.2013, 20:18
|
|
C++ | 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
| #include <iostream>
#include <cmath>
int main()
{
double R;
std::cin >> R;
double S, L, V;
if (R < 0)
std::cout << "Error!";
else
{
L = 2 * M_PI * R;
S = M_PI * R * R;
V = 4.0/3 * M_PI * R * R * R;
std::cout << "L = " << L << std::endl;
std::cout << "S = " << S << std::endl;
std::cout << "V = " << V << std::endl;
}
} |
|
1
|