結果

問題 No.668 6.0*10^23
ユーザー tonyu0tonyu0
提出日時 2020-04-07 08:51:12
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 513 bytes
コンパイル時間 11,567 ms
コンパイル使用メモリ 401,548 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-07 10:52:14
合計ジャッジ時間 13,289 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 50
権限があれば一括ダウンロードができます

ソースコード

diff #

use std::io::*;

fn main() {
    let mut s: String = String::new();
    std::io::stdin().read_to_string(&mut s).ok();
    let s: Vec<u32> = s
        .trim()
        .chars()
        .map(|c| c.to_digit(10).unwrap() as u32)
        .collect();
    let mut a = s[0];
    let mut b = s[1];
    if s[2] >= 5 {
        b += 1;
    }
    if b >= 10 {
        a += 1;
        b = 0;
    }
    if a >= 10 {
        println!("1.0*10^{}", s.len());
    } else {
        println!("{}.{}*10^{}", a, b, s.len() - 1);
    }
}
0