結果
| 問題 |
No.668 6.0*10^23
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-03-31 14:16:55 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 252 bytes |
| コンパイル時間 | 169 ms |
| コンパイル使用メモリ | 32,384 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-06-30 05:42:48 |
| 合計ジャッジ時間 | 1,507 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 50 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:5:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
5 | scanf("%Lg",&N);
| ~~~~~^~~~~~~~~~
ソースコード
#include <stdio.h>
#include <math.h>
int main() {
long double N;
scanf("%Lg",&N);
int N10 = log(N)/log(10);
float head = N/pow(10,N10);
if( head>9.95 ) {
head /= 10;
N10++;
}
printf("%Lg = %.1f*10^%d\n",N,head,N10);
return 0;
}