結果

問題 No.668 6.0*10^23
ユーザー かぼちゃ
提出日時 2018-03-23 23:09:49
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 4 ms / 2,000 ms
コード長 393 bytes
コンパイル時間 473 ms
コンパイル使用メモリ 59,228 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-30 05:21:54
合計ジャッジ時間 1,929 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 50
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;

int main() {
    
    string s;
    cin >> s;
    int a = s[0] - '0';
    int b = s[1] - '0';
    b += s[2]-'0' > 4 ? 1 : 0;
    if(b > 9){
        a += 1;
        b = 0;
    }
    if(a > 9)printf("1.0*10^%lu\n",s.length());
    else printf("%d.%d*10^%lu\n",a,b,s.length()-1);
    return 0;
}

0