From 7e273c40fb92c2860337cf0001b58db5b0efcaa1 Mon Sep 17 00:00:00 2001 From: tiennm99 Date: Sat, 29 Nov 2025 00:25:50 +0700 Subject: [PATCH] feat(rs): add hhcn --- .gitignore | 2 ++ rs/Cargo.lock | 7 +++++++ rs/Cargo.toml | 8 ++++++++ rs/hhcn.rs | 15 +++++++++++++++ 4 files changed, 32 insertions(+) create mode 100644 rs/Cargo.lock create mode 100644 rs/Cargo.toml create mode 100644 rs/hhcn.rs diff --git a/.gitignore b/.gitignore index 5b405c6..c66a162 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ .idea *.exe +debug +target \ No newline at end of file diff --git a/rs/Cargo.lock b/rs/Cargo.lock new file mode 100644 index 0000000..66f1585 --- /dev/null +++ b/rs/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "claoj" +version = "0.0.1" diff --git a/rs/Cargo.toml b/rs/Cargo.toml new file mode 100644 index 0000000..5cd5b20 --- /dev/null +++ b/rs/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "claoj" +version = "0.0.1" +edition = "2024" + +[[bin]] +name = "hhcn" +path = "hhcn.rs" \ No newline at end of file diff --git a/rs/hhcn.rs b/rs/hhcn.rs new file mode 100644 index 0000000..19054d3 --- /dev/null +++ b/rs/hhcn.rs @@ -0,0 +1,15 @@ +use std::io::{self, BufRead}; + +fn main() { + let mut input = String::new(); + io::stdin().lock().read_line(&mut input).unwrap(); + + let mut nums = input.split_whitespace().map(|x| x.parse::().unwrap()); + + let a = nums.next().unwrap(); + let b = nums.next().unwrap(); + let c = nums.next().unwrap(); + + let result = 4.0 * (a * b + b * c + c * a) / (a * b * c).sqrt(); + println!("{}", result); +}