結果

問題 No.668 6.0*10^23
ユーザー lapi
提出日時 2019-07-23 17:24:58
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 780 bytes
コンパイル時間 1,022 ms
コンパイル使用メモリ 106,308 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-26 04:36:05
合計ジャッジ時間 2,385 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 50
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <list>
#include <set>
#include <map>
#include <numeric>
#include <regex>
#include <tuple>
#include <iomanip>
#include <cmath>
using namespace std;

typedef long long ll;
typedef pair<int, int> P;
#define MOD 1000000007 // 10^9 + 7
#define INF 1000000000 // 10^9
#define LLINF 1LL<<60


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

	string S; cin >> S;
	int dig = S.size() - 1;
	int a = (S[0] - '0'); 
	int b = (S[1] - '0');
	int c = (S[2] - '0');

	//for(int i=0;i<3;i++) cout << S[i] << endl;

	if (c >= 5) b++;
	if (b == 10) {
		a++;
		b = 0;
	}
	if (a == 10) {
		a = 1;
		dig++;
	}

	cout << a << "." << b << "*10^" << dig << endl;

	return 0;
}
0