fork(1) download
  1. package main
  2.  
  3. import (
  4. "fmt"
  5. "strings"
  6. )
  7.  
  8. const num_count int = 65
  9. const fill_char string = "8"
  10.  
  11. const first_check string = "222"
  12. const first_change string = "8"
  13. const second_check string = "888"
  14. const second_change string = "2"
  15.  
  16. func main() {
  17. this_string := strings.Repeat(fill_char, num_count)
  18. for strings.Index(this_string, first_check) > -1 || strings.Index(this_string, second_check) > -1 {
  19. if strings.Index(this_string, first_check) > -1 {
  20. this_string = strings.Replace(this_string, first_check, first_change, 1)
  21. } else {
  22. this_string = strings.Replace(this_string, second_check, second_change, 1)
  23. }
  24. }
  25. fmt.Print(this_string)
  26. }
Success #stdin #stdout 0s 790016KB
stdin
Standard input is empty
stdout
8