반응형
https://www.acmicpc.net/problem/16600
16600번: Contemporary Art
At the Van Abbemuseum of modern and contemporary art in Eindhoven, we always look to present our muses in the most interesting way possible. Sometimes we have our work cut out for us. Today we are exploring whether we can modify one of our perfectly-square
www.acmicpc.net
간단한 산수문제였습니다.
📕 풀이방법
📔 입력 및 초기화
정사각형의 넓이를 입력할 double형 변수 square를 선언 후 입력합니다.
📔 풀이과정
넓이 = 가로 * 세로이므로 sqrt(square) * 4가 테두리의 길이 입니다.
📔 정답출력
소수점 8번째 자리까지 sqrt(square) * 4를 출력해줍니다.
📕 Code
#include <bits/stdc++.h>
using namespace std;
double square;
int main(){
cin >> square;
printf("%.8f", sqrt(square) * 4);
}
'Algorithm > Math' 카테고리의 다른 글
(C++) - 백준(BOJ) 16693 : Pizza Deal (0) | 2021.10.27 |
---|---|
(C++) - 백준(BOJ) 16648 : Accumulator Battery (0) | 2021.10.26 |
(C++) - 백준(BOJ) 15610 : Abbey Courtyard (0) | 2021.10.21 |
(C++) - 백준(BOJ) 13610 : Volta (0) | 2021.10.07 |
(C++) - 백준(BOJ) 19939번 : 박 터뜨리기 (0) | 2021.09.26 |