#define _USE_MATH_DEFINES
#include <iostream>
#include <iomanip>
using namespace std;
double area, circumference;
void circle(double);
int main() {
locale::global(locale(""));
cout << " Введите радиус: ";
double radius;
cin >> radius;
circle(radius);
streamsize accuracy = 8;
cout << " Длина окружности: " << setprecision(accuracy) << fixed << circumference << endl
<< " Площадь круга: " << area << endl;
cin.get(); cin.get();
return 0;
}
void circle(double _radius) {
circumference = 2 * M_PI * _radius;
area = M_PI * _radius * _radius;
Вроде бы так, если я тебе дай лучший ответ =) [с новым годом]
Поделитесь своими знаниями, ответьте на вопрос:
Определите значение переменной b после выполнения следующего фрагмента программы, в котором a и b - переменные вещественного (действительного) типа.
#define _USE_MATH_DEFINES
#include <iostream>
#include <iomanip>
using namespace std;
double area, circumference;
void circle(double);
int main() {
locale::global(locale(""));
cout << " Введите радиус: ";
double radius;
cin >> radius;
circle(radius);
streamsize accuracy = 8;
cout << " Длина окружности: " << setprecision(accuracy) << fixed << circumference << endl
<< " Площадь круга: " << area << endl;
cin.get(); cin.get();
return 0;
}
void circle(double _radius) {
circumference = 2 * M_PI * _radius;
area = M_PI * _radius * _radius;
}
Вроде бы так, если я тебе дай лучший ответ =) [с новым годом]