mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-12-26 07:31:59 +00:00
21 lines
393 B
Go
21 lines
393 B
Go
|
package main
|
||
|
|
||
|
import (
|
||
|
"bufio"
|
||
|
"os"
|
||
|
)
|
||
|
|
||
|
func main() {
|
||
|
file, _ := os.Open("copycat.in")
|
||
|
out, _ := os.OpenFile("copycat.out", os.O_WRONLY|os.O_CREATE, 0644)
|
||
|
reader := bufio.NewReader(file)
|
||
|
writer := bufio.NewWriter(out)
|
||
|
|
||
|
x, e := reader.ReadString('\n')
|
||
|
for e == nil {
|
||
|
x, e = reader.ReadString('\n')
|
||
|
writer.WriteString(x)
|
||
|
}
|
||
|
writer.Flush()
|
||
|
}
|