BOJ 문제풀이

백준 3053번 c++ 풀이

koreasunoo 2021. 8. 1. 19:44

안녕하세요 오늘은 기하학 문제를 풀어보겠습니다.

 

이 문제는 파이를 어떻게 표현할건지와, 어떻게 소수점 여섯 번째 자리까지 자를지 잘 알아야합니다.

 

코드:

#include <bits/stdc++.h>

using namespace std;

int main(){

	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);

	int a;
	cin>>a;
	cout<<fixed;
	cout.precision(6);
	cout<<pow(a, 2) * M_PI<<endl;
	cout<<pow(a, 2) * 2<<endl;


}

 

'BOJ 문제풀이' 카테고리의 다른 글

백준 1003번 c++ 풀이  (0) 2021.08.01
백준 7568번 c++ 풀이  (0) 2021.08.01
백준 4153번 c++ 풀이  (0) 2021.08.01
백준 3009번 c++ 풀이  (0) 2021.08.01
백준 1085번 c++ 풀이  (0) 2021.08.01