@nakov/

circle-area-methods-csharp

C#

Calculate a circle area using methods in C#

fork
loading
Files
  • main.cs
  • main.exe

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.6483502765734168","path":"main.cs","file":{"path":"main.cs","content":{"asEncoding":{"base64":"dXNpbmcgU3lzdGVtOwoKY2xhc3MgVHJpYW5nbGVPZkxldHRlcnMgewogICAgc3RhdGljIGRvdWJsZSBDYWxjQ2lyY2xlQXJlYShkb3VibGUgcmFkaXVzKQogICAgewogICAgICAgIHJldHVybiBNYXRoLlBJICogcmFkaXVzICogcmFkaXVzOwogICAgfQoKICAgIHN0YXRpYyB2b2lkIE1haW4oKQogICAgewogICAgICAgIENvbnNvbGUuV3JpdGVMaW5lKCJyID0gezB9LCBhcmVhID0gezF9IiwgNSwgQ2FsY0NpcmNsZUFyZWEoNSkpOwogICAgICAgIENvbnNvbGUuV3JpdGVMaW5lKCJyID0gezB9LCBhcmVhID0gezF9IiwgMi44LCBDYWxjQ2lyY2xlQXJlYSgyLjgpKTsKICAgIH0KfQo="},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
using System;

class TriangleOfLetters {
    static double CalcCircleArea(double radius)
    {
        return Math.PI * radius * radius;
    }

    static void Main()
    {
        Console.WriteLine("r = {0}, area = {1}", 5, CalcCircleArea(5));
        Console.WriteLine("r = {0}, area = {1}", 2.8, CalcCircleArea(2.8));
    }
}