Notice
Recent Posts
Recent Comments
Link
알고리즘 모음(C++)
백준 3053 - 택시 기하학(C++) 본문
문제 링크입니다. https://www.acmicpc.net/problem/3053
3053번: 택시 기하학
첫째 줄에는 유클리드 기하학에서 반지름이 R인 원의 넓이를, 둘째 줄에는 택시 기하학에서 반지름이 R인 원의 넓이를 출력한다. 정답과의 오차는 0.0001까지 허용한다.
www.acmicpc.net
유클리드 기하학 원의 의미를 알아야되는 문제입니다.
자세한 것은 코드를 참고해주세요.
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstring>
#include <vector>
#include <algorithm>
#include <queue>
#include <cmath>
#include <cstdio>
#include <string>
#include <deque>
#include <stack>
#define P pair<int,int>
#define PP pair<P, int>
#define F first
#define S second
#define LL long long
using namespace std;
double N;
void solve(){
printf("%.6f\n", N * N * 3.141592653589793238462643383);
printf("%.6f", 2*N*N);
}
int main() {
cin.tie(0);
cout.tie(0);
cin >> N;
solve();
return 0;
}
질문 및 조언은 댓글을 남겨주세요
'백준' 카테고리의 다른 글
백준 2470 - 두 용액(C++) (0) | 2023.01.16 |
---|---|
백준 27112 - 시간 외 근무 멈춰!(C++) (0) | 2023.01.16 |
백준 4673 - 셀프 넘버(C++) (2) | 2023.01.15 |
백준 27111 - 출입 기록(C++) (0) | 2023.01.15 |
백준 27110 - 특식 배부(C++) (0) | 2023.01.15 |