#include #include <Windows.h>
//让用户输入一个圆的半径,计算这个圆的周长和面积,并输出(保留两位小数) int main(void) { float s; //半径 float len; //周长 float d; //面积
std::cout << "请输入圆的半径:";
std::cin >> s;
len = 2 * 3.14 * s;
d = 3.14 * s * s;
//保留两位小数
std::cout.precision(2);
std::cout.flags(std::cout.fixed);
std::cout << "圆的周长是:" << len <<std::endl;
std::cout << "圆的面积是:" << d << std::endl;
system("pause");
return 0;
}