update file go/l10.go: added new function recovery for to turn a phrase around

This commit is contained in:
hhu67 2026-06-04 23:00:59 +03:00
parent 992fb88d6c
commit 56fe5539ad
2 changed files with 11 additions and 2 deletions

View file

@ -26,8 +26,17 @@ func vowel(vow string) int {
return wovel 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() { func main() {
po1, po2 := polz() po1, po2 := polz()
fmt.Println(vowel(po1)) fmt.Println("Вот колличество гласных в первом", vowel(po1))
fmt.Println(po1, po2) fmt.Println("Вот слова", po1, po2)
fmt.Println("Вот перевернутое первое слово", recovery(po1))
} }

Binary file not shown.