updated template to use updated input

This commit is contained in:
2024-12-11 20:12:36 +01:00
parent a215df0b04
commit 4d27eb650b

View File

@@ -1,7 +1,30 @@
package main
import "fmt"
import (
"bufio"
"fmt"
"log"
"os"
"strings"
)
func original() {
fmt.Println("Original Code")
// Open the input file
file, err := os.Open("./input.txt")
if err != nil {
log.Fatalf("Error opening input.txt: %v", err)
}
defer file.Close()
// Read and parse input file
scanner := bufio.NewScanner(file)
for scanner.Scan() {
line := strings.Fields(scanner.Text())
if len(line) != 2 {
log.Fatalf("Invalid input format: %s", scanner.Text())
}
//
}
}