結果

問題 No.668 6.0*10^23
ユーザー SKanaya
提出日時 2018-03-31 14:17:25
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 244 bytes
コンパイル時間 169 ms
コンパイル使用メモリ 32,384 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-06-30 05:42:53
合計ジャッジ時間 1,471 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 7 WA * 43
権限があれば一括ダウンロードができます
コンパイルメッセージ
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);
      |   ~~~~~^~~~~~~~~~

ソースコード

diff #

#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("%.1f*10^%d\n",head,N10);
  return 0;
}
0