From edde6605a256e21946d7937f5b9e4ab21f20bf5f Mon Sep 17 00:00:00 2001 From: Mladen Danic Date: Sun, 16 Nov 2025 23:50:43 +0100 Subject: [PATCH 1/3] Add solution for Challenge 1 by Maidomax --- .../submissions/Maidomax/solution-template.go | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 challenge-1/submissions/Maidomax/solution-template.go diff --git a/challenge-1/submissions/Maidomax/solution-template.go b/challenge-1/submissions/Maidomax/solution-template.go new file mode 100644 index 00000000..ad02c049 --- /dev/null +++ b/challenge-1/submissions/Maidomax/solution-template.go @@ -0,0 +1,25 @@ +package main + +import ( + "fmt" +) + +func main() { + var a, b int + // Read two integers from standard input + _, err := fmt.Scanf("%d, %d", &a, &b) + if err != nil { + fmt.Println("Error reading input:", err) + return + } + + // Call the Sum function and print the result + result := Sum(a, b) + fmt.Println(result) +} + +// Sum returns the sum of a and b. +func Sum(a int, b int) int { + // TODO: Implement the function + return a + b +} From 87adf9954ed2dbe7efecf5efe260aa174a7a27d7 Mon Sep 17 00:00:00 2001 From: Mladen Danic Date: Mon, 17 Nov 2025 00:10:40 +0100 Subject: [PATCH 2/3] Add solution for Challenge 2 by Maidomax --- .../submissions/Maidomax/solution-template.go | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 challenge-2/submissions/Maidomax/solution-template.go diff --git a/challenge-2/submissions/Maidomax/solution-template.go b/challenge-2/submissions/Maidomax/solution-template.go new file mode 100644 index 00000000..4deda0ab --- /dev/null +++ b/challenge-2/submissions/Maidomax/solution-template.go @@ -0,0 +1,33 @@ +package main + +import ( + "bufio" + "fmt" + "os" +) + +func main() { + // Read input from standard input + scanner := bufio.NewScanner(os.Stdin) + if scanner.Scan() { + input := scanner.Text() + + // Call the ReverseString function + output := ReverseString(input) + + // Print the result + fmt.Println(output) + } +} + +// ReverseString returns the reversed string of s. +func ReverseString(s string) string { + runes := []rune(s) + size := len(runes) + + for i:=0; i < size / 2; i++ { + runes[i], runes[size-i-1] = runes[size-i-1], runes[i] + } + + return string(runes) +} From 503f1edabdcfe6ba13d79ecc556ebd5fc8793757 Mon Sep 17 00:00:00 2001 From: Mladen Danic Date: Tue, 18 Nov 2025 16:33:45 +0100 Subject: [PATCH 3/3] Add solution for Challenge 18 by Maidomax --- .../submissions/Maidomax/solution-template.go | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 challenge-18/submissions/Maidomax/solution-template.go diff --git a/challenge-18/submissions/Maidomax/solution-template.go b/challenge-18/submissions/Maidomax/solution-template.go new file mode 100644 index 00000000..58c03ce3 --- /dev/null +++ b/challenge-18/submissions/Maidomax/solution-template.go @@ -0,0 +1,39 @@ +package main + +import ( + "fmt" + "math" +) + +func main() { + // Example usage + celsius := 25.0 + fahrenheit := CelsiusToFahrenheit(celsius) + fmt.Printf("%.2f°C is equal to %.2f°F\n", celsius, fahrenheit) + + fahrenheit = 68.0 + celsius = FahrenheitToCelsius(fahrenheit) + fmt.Printf("%.2f°F is equal to %.2f°C\n", fahrenheit, celsius) +} + +// CelsiusToFahrenheit converts a temperature from Celsius to Fahrenheit +// Formula: F = C × 9/5 + 32 +func CelsiusToFahrenheit(celsius float64) float64 { + // TODO: Implement this function + // Remember to round to 2 decimal places + return Round((9.0/5.0) * celsius + 32, 2); +} + +// FahrenheitToCelsius converts a temperature from Fahrenheit to Celsius +// Formula: C = (F - 32) × 5/9 +func FahrenheitToCelsius(fahrenheit float64) float64 { + // TODO: Implement this function + // Remember to round to 2 decimal places + return Round((fahrenheit-32) * (5.0/9.0), 2) +} + +// Round rounds a float64 value to the specified number of decimal places +func Round(value float64, decimals int) float64 { + precision := math.Pow10(decimals) + return math.Round(value*precision) / precision +}