update file go/l10.go: added new function recovery for to turn a phrase around
This commit is contained in:
parent
992fb88d6c
commit
56fe5539ad
2 changed files with 11 additions and 2 deletions
13
go/l10.go
13
go/l10.go
|
|
@ -26,8 +26,17 @@ func vowel(vow string) int {
|
|||
return wovel
|
||||
}
|
||||
|
||||
func recovery(rec string) string {
|
||||
runes := []rune(rec)
|
||||
for i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {
|
||||
runes[i], runes[j] = runes[j], runes[i]
|
||||
}
|
||||
return string(runes)
|
||||
}
|
||||
|
||||
func main() {
|
||||
po1, po2 := polz()
|
||||
fmt.Println(vowel(po1))
|
||||
fmt.Println(po1, po2)
|
||||
fmt.Println("Вот колличество гласных в первом", vowel(po1))
|
||||
fmt.Println("Вот слова", po1, po2)
|
||||
fmt.Println("Вот перевернутое первое слово", recovery(po1))
|
||||
}
|
||||
BIN
go/output/l10
BIN
go/output/l10
Binary file not shown.
Loading…
Reference in a new issue