結果

問題 No.480 合計
ユーザー mabupro
提出日時 2022-12-12 10:21:53
言語 C
(gcc 13.3.0)
結果
RE  
実行時間 -
コード長 169 bytes
コンパイル時間 198 ms
コンパイル使用メモリ 28,544 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-06 09:08:32
合計ジャッジ時間 3,784 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other RE * 22
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function 'main':
main.c:9:12: warning: passing argument 1 of 'printf' makes pointer from integer without a cast [-Wint-conversion]
    9 |     printf(ans);
      |            ^~~
      |            |
      |            int
In file included from main.c:1:
/usr/include/stdio.h:356:43: note: expected 'const char * restrict' but argument is of type 'int'
  356 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~

ソースコード

diff #

#include <stdio.h>
int main(void){
    int x;
    int ans=0;
    scanf("%d",&x);
    for(int i=0;i<=x;i++){
        ans = ans + i;
    }
    printf(ans);
    return 0;
}
0