結果

問題 No.536 人工知能
ユーザー siman
提出日時 2017-07-05 02:36:06
言語 Go
(1.23.4)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 401 bytes
コンパイル時間 13,262 ms
コンパイル使用メモリ 237,780 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-05 16:26:54
合計ジャッジ時間 11,230 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

package main

import (
  "fmt"
	"bufio"
	"os"
	"io"
	"strings"
)

func main () {
	fp := os.Stdin
	reader := bufio.NewReaderSize(fp, 4096)

	for {
		line, _, err := reader.ReadLine()
		str := string(line)
		if err == io.EOF {
			break
		} else if err != nil {
			panic(err)
		}
		if strings.HasSuffix(str, "ai") {
			fmt.Println(str[:len(str)-2] + "AI")
		} else {
			fmt.Println(str + "-AI")
		}
	}
}
0