結果

問題 No.480 合計
ユーザー UoMJ3E5VRmVwkKz
提出日時 2018-01-31 15:56:55
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 201 bytes
コンパイル時間 255 ms
コンパイル使用メモリ 23,680 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-29 23:47:59
合計ジャッジ時間 1,134 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
外部呼び出し有り
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:8:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    8 |         scanf("%d", &N);
      |         ~~~~~^~~~~~~~~~
main.cpp:16:15: warning: ignoring return value of ‘int system(const char*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   16 |         system("pause");
      |         ~~~~~~^~~~~~~~~

ソースコード

diff #

#include<stdio.h>
#include<stdlib.h>

int main() {
	int N = -1;
	int sum = 0;

	scanf("%d", &N);

	for (int i = 1; i <= N; i++) {
		sum += i;
	}

	printf("%d", sum);

	system("pause");
	return 0;
}



0