結果

問題 No.668 6.0*10^23
ユーザー kriii
提出日時 2018-03-27 00:03:58
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 286 bytes
コンパイル時間 105 ms
コンパイル使用メモリ 21,632 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-30 05:39:19
合計ジャッジ時間 1,346 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 50
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:7:15: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    7 |         scanf ("%s",S);
      |         ~~~~~~^~~~~~~~

ソースコード

diff #

#include <stdio.h>

char S[100100];

int main()
{
	scanf ("%s",S);
	int L = 0; while (S[L]) L++; L--;

	if (S[2] >= '5'){
		S[1]++;
		if (S[1] > '9'){
			S[1] = '0';
			S[0]++;
			if (S[0] > '9'){
				S[0] = '1';
				L++;
			}
		}
	}

	printf ("%c.%c*10^%d\n",S[0],S[1],L);
	return 0;
}
0