結果
問題 | No.499 7進数変換 |
ユーザー |
![]() |
提出日時 | 2017-07-20 14:07:54 |
言語 | Go (1.23.4) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 448 bytes |
コンパイル時間 | 14,828 ms |
コンパイル使用メモリ | 219,492 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-08 17:42:01 |
合計ジャッジ時間 | 13,434 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 31 |
ソースコード
package mainimport ("bufio""fmt""os")func main() {scnr := bufio.NewScanner(os.Stdin)scnr.Split(bufio.ScanWords)for scnr.Scan() {var n intif x, _ := fmt.Sscanf(scnr.Text(), "%d", &n); x != 1 {break}var ans []intfor ; n > 0; n /= 7 {ans = append(ans, n%7)}if len(ans) == 0 {fmt.Println(0)} else {for i := len(ans) - 1; i > 0; i-- {fmt.Print(ans[i])}fmt.Println(ans[0])}}}