[백준] C# : 택시 기하학 (3053번)

ssu_hyun·2022년 8월 13일
0

Data Structure & Algorithm

목록 보기
53/67

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Baekjoon
{
    class Program
    {
        static void Main(string[] args)
        {
            int r = int.Parse(Console.ReadLine());

            // 유클리드 기하학에서 원의 넓이 = PI * r^2
            Console.WriteLine(Math.PI * r*r);
            // 택시 기하학에서 원(마름모)의 넓이 = 2*r^2
            // 마름모 넓이 공식 = 한대각선*다른대각선 / 2
            Console.WriteLine(2 * r * r);
        }
    }
}

0개의 댓글