123456789101112131415161718192021222324252627282930 |
- package main
- import (
- "bufio"
- "fmt"
- "os"
- )
- func main() {
- input := bufio.NewScanner(os.Stdin)
- var output string
- for input.Scan() {
- line := input.Text()
- output = replaceSpace(line)
- fmt.Println(output)
- }
- }
- func replaceSpace(s string) string {
- var last string
- for _, v := range s {
- if string(v) == " " {
- last += "%20"
- continue
- }
- last += string(v)
- }
- return last
- }
|