mirror of https://github.com/01-edu/public.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
578 B
38 lines
578 B
5 years ago
|
package main
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
"os"
|
||
5 years ago
|
"strings"
|
||
5 years ago
|
)
|
||
|
|
||
|
func main() {
|
||
5 years ago
|
var a1, a2, rev []rune
|
||
|
for _, arg := range os.Args[1:] {
|
||
|
for _, k := range arg {
|
||
|
if strings.ContainsRune("aeiouAEIOU", k) {
|
||
|
a1 = append(a1, k)
|
||
5 years ago
|
}
|
||
|
}
|
||
|
}
|
||
5 years ago
|
for i := len(a1) - 1; i >= 0; i-- {
|
||
|
rev = append(rev, a1[i])
|
||
5 years ago
|
}
|
||
|
|
||
|
m := 0
|
||
5 years ago
|
for i, arg := range os.Args[1:] {
|
||
|
for _, j := range arg {
|
||
|
if strings.ContainsRune("aeiouAEIOU", j) {
|
||
|
a2 = append(a2, rev[m])
|
||
5 years ago
|
m++
|
||
|
} else {
|
||
5 years ago
|
a2 = append(a2, j)
|
||
5 years ago
|
}
|
||
|
}
|
||
|
if i != len(os.Args)-1 {
|
||
5 years ago
|
a2 = append(a2, ' ')
|
||
5 years ago
|
}
|
||
|
}
|
||
5 years ago
|
fmt.Println(string(a2))
|
||
5 years ago
|
}
|