题目描述
要注意使用double,输出要换行
样例
#include<iostream>
#include<iomanip>
using namespace std;
int main() {
double A, B, C;
cin >> A >> B >> C;
const double pi = 3.14159;
double sanjiao = 1 / 2.0 * A * C;
double yuan = pi * C * C;
double tixing = (A + B) * C * 1 / 2.0;
double zhengfang = B * B;
double changfang = A * B;
cout << fixed << setprecision(3) << "TRIANGULO: " << sanjiao << endl;
cout << fixed << setprecision(3) << "CIRCULO: " << yuan << endl;
cout << fixed << setprecision(3) << "TRAPEZIO: " << tixing << endl;
cout << fixed << setprecision(3) << "QUADRADO: " << zhengfang << endl;
cout << fixed << setprecision(3) << "RETANGULO: " << changfang << endl;
return 0;
}
算法1
(暴力枚举) $O(n^2)$
blablabla
时间复杂度
参考文献
C++ 代码
blablabla
算法2
(暴力枚举) $O(n^2)$
blablabla
时间复杂度
参考文献
C++ 代码
blablabla