27 lines
343 B
Go
27 lines
343 B
Go
|
package main
|
||
|
|
||
|
import (
|
||
|
"bufio"
|
||
|
"fmt"
|
||
|
"os"
|
||
|
)
|
||
|
|
||
|
func main() {
|
||
|
m := Matrix{}
|
||
|
|
||
|
s := bufio.NewScanner(os.Stdin)
|
||
|
for s.Scan() {
|
||
|
var x1, x2, y1, y2 int
|
||
|
_, _ = fmt.Sscanf(s.Text(), "%d,%d -> %d,%d", &x1, &y1, &x2, &y2)
|
||
|
m.DrawLine(x1, y1, x2, y2)
|
||
|
}
|
||
|
|
||
|
sum := 0
|
||
|
for _, count := range m {
|
||
|
if count > 1 {
|
||
|
sum++
|
||
|
}
|
||
|
}
|
||
|
fmt.Println(sum)
|
||
|
}
|