package main import ( "bufio" "fmt" "os" ) var ( s1, s2 string ) func scanInput() string { scanner := bufio.NewScanner(os.Stdin) var s string for scanner.Scan() { s = scanner.Text() break } return s } func noDup(s string) { for i := 0; i < len(s) - 1; i++ { if s[i] != s[i+1] { fmt.Printf("%s", string(s[i])) } } fmt.Printf("%s", string(s[len(s) - 1])) } func main() { ss := scanInput() noDup(ss) }
08-27
05-30