結果

問題 No.668 6.0*10^23
ユーザー ts_
提出日時 2018-03-26 01:03:17
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 4 ms / 2,000 ms
コード長 445 bytes
コンパイル時間 1,639 ms
コンパイル使用メモリ 160,612 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-30 05:39:10
合計ジャッジ時間 2,898 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 50
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)   FOR(i,0,n)
#define pb emplace_back
typedef long long ll;
typedef pair<int,int> pint;

int main(){
    string s;
    cin>>s;
    int n=s.size();
    string t=s.substr(0,3);
    int ti=stoi(t);
    if(ti%10>4) ti+=10;
    ti-=ti%10;
    t=to_string(ti);
    if(t.size()<=3) --n;
    cout<<t[0]<<"."<<t[1]<<"*10^"<<n<<endl;
    return 0;
}
0