Skip to content

Commit

Permalink
Create areal
Browse files Browse the repository at this point in the history
* C++
* Haskell
* JavaScript (Node.js)
* Python
* Ruby
  • Loading branch information
EntityPlantt committed Aug 15, 2022
1 parent cd95eb0 commit e9a13d6
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 0 deletions.
11 changes: 11 additions & 0 deletions areal.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// GitHub: EntityPlantt/Kattis
#include <iostream>
#include <cmath>
using namespace std;
int main() {
long double n;
cin >> n;
cout.precision(20);
cout << sqrt(n) * 4.0;
return 0;
}
5 changes: 5 additions & 0 deletions areal.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-- GitHub: EntityPlantt/Kattis
main = do
n <- getLine
let x = (read n :: Double)
print(sqrt x * 4)
4 changes: 4 additions & 0 deletions areal.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// GitHub: EntityPlantt/Kattis
require("readline").createInterface({input: process.stdin}).on("line", n => {
console.log(Math.sqrt(parseFloat(n)) * 4);
});
3 changes: 3 additions & 0 deletions areal.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# GitHub: EntityPlantt/Kattis
import math
print(math.sqrt(float(input())) * 4)
2 changes: 2 additions & 0 deletions areal.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# GitHub: EntityPlantt/Kattis
puts Math.sqrt($stdin.read.to_f) * 4.0

0 comments on commit e9a13d6

Please sign in to comment.