結果

問題 No.9006 マルチバイト文字テスト(テスト用)
ユーザー gogoteagogotea
提出日時 2015-03-25 01:49:15
言語 Go
(1.22.1)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 413 bytes
コンパイル時間 11,635 ms
コンパイル使用メモリ 238,812 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-04-18 10:18:57
合計ジャッジ時間 12,159 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 1 ms
5,248 KB
testcase_02 AC 1 ms
5,248 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package main

import (
	"bufio"
	"fmt"
	"os"
	"unicode/utf8"
)

func main() {
	s := next()
	fmt.Println(reverse(s))
}

func reverse(s string) string {
	result := make([]rune, utf8.RuneCountInString(s))
	i := len(result) - 1
	for _, c := range s {
		result[i] = c
		i--
	}
	return string(result)
}

var sc = bufio.NewScanner(os.Stdin)

func next() string {
	sc.Split(bufio.ScanWords)
	sc.Scan()
	return sc.Text()
}
0