結果
| 問題 |
No.9008 空白区切りで与えられる数値データの合計値を求める(テスト用)
|
| ユーザー |
|
| 提出日時 | 2025-09-15 17:57:50 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 250 bytes |
| コンパイル時間 | 239 ms |
| コンパイル使用メモリ | 26,672 KB |
| 実行使用メモリ | 7,720 KB |
| 最終ジャッジ日時 | 2025-09-15 17:57:52 |
| 合計ジャッジ時間 | 1,450 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 4 |
| other | WA * 15 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:11:19: warning: format ‘%d’ expects argument of type ‘int *’, but argument 2 has type ‘long long int *’ [-Wformat=]
11 | scanf("ll%d",&data[i]);
| ~^ ~~~~~~~~
| | |
| | long long int *
| int *
| %lld
main.c:6:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
6 | scanf("%d", &N);
| ^~~~~~~~~~~~~~~
main.c:11:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
11 | scanf("ll%d",&data[i]);
| ^~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
int main(void) {
int N;
long long int sum = 0;
scanf("%d", &N);
long long int data[N];
for(int i = 0; i < N; i++) {
scanf("ll%d",&data[i]);
sum += data[i];
}
printf("%lld\n", sum);
return 0;
}