結果

問題 No.668 6.0*10^23
ユーザー kashi3215kashi3215
提出日時 2018-07-04 17:35:15
言語 C++11
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 333 bytes
コンパイル時間 178 ms
コンパイル使用メモリ 22,528 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-01 02:13:35
合計ジャッジ時間 1,616 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 47 WA * 3
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:5:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    5 |         scanf("%s", a);
      |         ~~~~~^~~~~~~~~

ソースコード

diff #

#include<cstdio>
int main(void) {
	char a[100010];
	int A, B, C, i;
	scanf("%s", a);
	for (i = 0; a[i] != '\0'; i++);
	A = (int)a[0] - 48;
	B = (int)a[1] - 48;
	C = (int)a[2] - 48;
	if (C > 4) {
		B = B + 1;
		if (B > 9) {
			A = A + 1;
			if (A > 9) { A = 1; B = 0; i++; }
		}
		}
	printf("%d.%d*10^%d\n", A, B, i - 1);
	return 0;
}
0