結果

問題 No.89 どんどんドーナツどーんといこう!
ユーザー umashikaumashika
提出日時 2016-02-25 00:02:56
言語 C90
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 275 bytes
コンパイル時間 283 ms
コンパイル使用メモリ 23,016 KB
実行使用メモリ 4,372 KB
最終ジャッジ日時 2023-10-23 19:42:37
合計ジャッジ時間 713 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 0 ms
4,348 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 1 ms
4,348 KB
testcase_09 AC 0 ms
4,348 KB
testcase_10 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:15:12: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘double’ [-Wformat=]
   15 |   printf("%d\n",ans);
      |           ~^    ~~~
      |            |    |
      |            int  double
      |           %f
main.c:11:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   11 |   scanf("%d %d %d",&c,&Rin,&Rout);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include<stdio.h>
#include<math.h>

int main()
{
  int c;
  int Rin;
  int Rout;
  double ans;

  scanf("%d %d %d",&c,&Rin,&Rout);

  //(π*Rout*Rou)*(Rin+Rout/2)*c;
  ans =(M_PI+(double)Rout*(double)Rout)*((double)Rin+(double)Rout/2)*c;
  printf("%d\n",ans);
  return 0;
}

0