//3.10funcmain(){var buf bytes.Buffer
v:="1234"
h:=len(v)%3
fmt.Printf("%d\n",h)for i :=0; i <len(v); i++{if(i+1==h||(i-h)%3==0)&&i!=0{
buf.WriteString(",")}
fmt.Fprintf(&buf,"%c",v[i])}
fmt.Println(buf.String())}
//3.12funcmain(){
fmt.Printf("plz input the first string: \n")var a []bytevar b []byte
fmt.Scanf("%s",&a)
fmt.Printf("plz input the first string: \n")
fmt.Scanf("%s",&b)
n:=len(a)
m:=len(b)
count:=0for i :=0; i < m; i++{for j :=0; j < n; j++{if a[i]==b[j]{
b[j]='/'break}}}for i :=0; i < m; i++{if b[i]=='/'{
count++}}if count!=m||m!=n{
fmt.Printf("sorry.not the same.")}else{
fmt.Printf("congra.same.")}}
//4.4 rotatefuncrotate(s []int,n int)[]int{var m []intfor i :=0; i <len(s); i++{
m=append(m,s[len(s)-i-1])}return m
}funcmain(){
s :=[]int{1,2,3,4,5}
m:=rotate(s,len(s))
fmt.Println(m)}
//4.5 []string临近字符串操作funcde(s []string)[]string{for i :=0; i <len(s)-1; i++{if s[i]==s[i+1]{
s[i]="."}}return s
}funcmain(){
s:=[]string{"a","a","b","c","c","c","d","d","e","e","e","e","f","g","h","k","k"}
m:=de(s)var b []stringfor j :=0; j <len(m); j++{if m[j]=="."{continue}
b=append(b,m[j])}
fmt.Println(b)}