結果

問題 No.668 6.0*10^23
ユーザー Mister
提出日時 2020-04-21 21:50:40
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 4 ms / 2,000 ms
コード長 522 bytes
コンパイル時間 903 ms
コンパイル使用メモリ 67,328 KB
最終ジャッジ日時 2025-01-09 22:11:07
ジャッジサーバーID
(参考情報)
judge3 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 50
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>

void solve() {
    std::string s;
    std::cin >> s;

    bool up = (s[2] >= '5');
    for (int i = 1; i >= 0; --i) {
        if (up) ++s[i];
        up = false;

        if (s[i] > '9') {
            s[i] = '0';
            up = true;
        }
    }

    if (up) s.insert(s.begin(), '1');

    std::cout << s[0] << "." << s[1] << "*10^" << s.length() - 1 << std::endl;
}

int main() {
    std::cin.tie(nullptr);
    std::ios::sync_with_stdio(false);

    solve();

    return 0;
}
0