输入圆的半径和高,依次输出圆周长,圆面积,圆球表面积,圆柱体积

#include 
using namespace std;
int main()
{
	float r, h, c, s1, s2, v;
	cin >> r >> h;
	c = 2 * 3.14 * r;
	s1 = r * r * 3.14;
	s2 = 4 * 3.14 * r * r;
	v = s1 * h;
	cout << c << " " << s1 << " " << s2 << " " << v;
	return 0;
}

你可能感兴趣的:(C++基础代码,c++)