結果

問題 No.1622 三角形の面積
ユーザー Maeda
提出日時 2025-03-13 17:36:05
言語 C
(gcc 13.3.0)
結果
RE  
実行時間 -
コード長 302 bytes
コンパイル時間 276 ms
コンパイル使用メモリ 25,728 KB
実行使用メモリ 7,328 KB
最終ジャッジ日時 2025-03-13 17:36:07
合計ジャッジ時間 1,829 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample RE * 1
other RE * 4
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:8:26: warning: format ‘%le’ expects argument of type ‘double *’, but argument 2 has type ‘double’ [-Wformat=]
    8 |                 scanf("%le",triangleList[i]);
      |                        ~~^  ~~~~~~~~~~~~~~~
      |                          |              |
      |                          double *       double
main.c:12:23: warning: zero width in gnu_scanf format [-Wformat=]
   12 |                 scanf("%0.12f",triangleList[i]);
      |                       ^~~~~~~~
main.c:12:26: warning: unknown conversion type character ‘.’ in format [-Wformat=]
   12 |                 scanf("%0.12f",triangleList[i]);
      |                          ^
main.c:12:23: warning: too many arguments for format [-Wformat-extra-args]
   12 |                 scanf("%0.12f",triangleList[i]);
      |                       ^~~~~~~~
main.c:5:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    5 |         scanf("%d",&t);
      |         ^~~~~~~~~~~~~~
main.c:8:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    8 |                 scanf("%le",triangleList[i]);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.c:12:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   12 |                 scanf("%0.12f",triangleList[i]);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>

void main(void){
	int t = 0;
	scanf("%d",&t);
	double triangleList[t];
	for(int i = 0 ; i < t ; i++){
		scanf("%le",triangleList[i]);
		triangleList[i] = 1.299038105676657 * triangleList[i] * triangleList[i];
	}
	for(int i = 0 ; i < t ; i++){
		scanf("%0.12f",triangleList[i]);
	}
}
0