結果

問題 No.9008 空白区切りで与えられる数値データの合計値を求める(テスト用)
ユーザー hsmb
提出日時 2017-05-08 23:44:06
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 44 ms / 2,000 ms
コード長 213 bytes
コンパイル時間 199 ms
コンパイル使用メモリ 22,272 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-14 17:36:37
合計ジャッジ時間 1,906 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 15
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main(int, char**)’:
main.cpp:7:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    7 |         scanf("%d",&n);
      |         ~~~~~^~~~~~~~~
main.cpp:11:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   11 |                 scanf("%llu",&a);
      |                 ~~~~~^~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>

int main(int argc, char *argv[]){
	unsigned long long int a,b,r;
	int i,n;

	scanf("%d",&n);
	
	r = 0;
	for(i=0; i<n ;i++){
		scanf("%llu",&a);
		r += a;
	}

	printf("%llu\n", r);

	return 0;
}
0