Skip to content

Commit 3ce23a3

Browse files
authored
Add solution for Challenge 1 by ansmonjol (#751)
1 parent f7552e0 commit 3ce23a3

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package main
2+
3+
import (
4+
"fmt"
5+
)
6+
7+
func main() {
8+
var a, b int
9+
// Read two integers from standard input
10+
_, err := fmt.Scanf("%d, %d", &a, &b)
11+
if err != nil {
12+
fmt.Println("Error reading input:", err)
13+
return
14+
}
15+
16+
// Call the Sum function and print the result
17+
result := Sum(a, b)
18+
fmt.Println(result)
19+
}
20+
21+
// Sum returns the sum of a and b.
22+
func Sum(a int, b int) int {
23+
return a + b
24+
}

0 commit comments

Comments
 (0)