[boj] (b3) 3053 택시 기하학

강신현·2022년 4월 1일
0

✅ 수학

문제

링크

풀이

코드

#include <iostream>
#include <cmath>
#define _USE_MATH_DEFINES

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    double r;
    cin >> r;
    
    cout.precision(6);
    cout << fixed;

    // 유클리드 기하학
    cout << pow(r, 2) * M_PI << '\n';

    // 택시 기하학
    cout << 2 * pow(r, 2);

    return 0;
}
profile
땅콩의 모험 (server)

0개의 댓글