結果
| 問題 | No.9008 空白区切りで与えられる数値データの合計値を求める(テスト用) |
| ユーザー |
nanatutmc
|
| 提出日時 | 2019-09-12 00:40:14 |
| 言語 | C11(gcc12 gnu拡張) (gcc 12.4.0) |
| 結果 |
AC
|
| 実行時間 | 25 ms / 2,000 ms |
| + 84µs | |
| コード長 | 234 bytes |
| 記録 | |
| コンパイル時間 | 42 ms |
| コンパイル使用メモリ | 28,800 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-07-28 02:04:42 |
| 合計ジャッジ時間 | 1,571 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 15 |
コンパイルメッセージ
main.c:3:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
3 | main() {
| ^~~~
main.c: In function ‘main’:
main.c:6:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
6 | scanf("%d", &count);
| ^~~~~~~~~~~~~~~~~~~
main.c:10:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
10 | scanf("%ld", &num);
| ^~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
main() {
int count;
long sum = 0;
scanf("%d", &count);
for (int i=0; i<count; i++) {
long num;
scanf("%ld", &num);
sum += num;
}
printf("%ld\n", sum);
}
nanatutmc