0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-23 21:28:48 +00:00

#3. 复读机

https://loj.ac/s/1478112
This commit is contained in:
Baoshuo Ren 2022-06-08 14:02:12 +08:00
parent 7cbe9ac776
commit 62acf47540
Signed by: baoshuo
GPG Key ID: 70F90A673FB1AB68

20
LibreOJ/3/3.go Normal file
View File

@ -0,0 +1,20 @@
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()
}