Перевернуть строку

Messages
1,608
Reaction score
288
Website
tehadm.ru
C-like:
package main

import "fmt"

func main() {
    var str string
    fmt.Scan(&str)

    fmt.Println(Solution(str))

}

func Solution(word string) string {
    var newStr string
    for i := len(word) - 1; i >= 0; i-- {
        newStr += string(word[i])
    }
    return newStr
}
 
Back
Top