結果

問題 No.668 6.0*10^23
ユーザー CELICA
提出日時 2020-08-18 21:45:19
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 525 bytes
コンパイル時間 1,485 ms
コンパイル使用メモリ 169,912 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-12 03:15:36
合計ジャッジ時間 3,258 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 50
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using ul = unsigned long;

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

    string n;
    cin >> n;

    int ni = (stoi(n.substr(0, 3)) + 5) / 10;
    int e = n.size() - 1;
    double d = ni;
    if (ni < 100)
        d /= 10.0;
    else
    {
        d /= 100.0;
        ++e;
    }

    stringstream res;
    res << fixed << setprecision(1) << d;
    res << "*10^" << to_string(e);

    cout << res.str() << "\n";

    return 0;
}
0