結果

問題 No.480 合計
ユーザー Ysk0418
提出日時 2017-07-05 00:55:11
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
RE  
(最新)
AC  
(最初)
実行時間 -
コード長 223 bytes
コンパイル時間 284 ms
コンパイル使用メモリ 22,528 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-12-14 09:31:01
合計ジャッジ時間 3,470 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other RE * 22
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:8:13: warning: format ‘%d’ expects argument of type ‘int*’, but argument 2 has type ‘unsigned char*’ [-Wformat=]
    8 |     scanf("%d",&A);
      |            ~^  ~~
      |             |  |
      |             |  unsigned char*
      |             int*
      |            %hhd
main.cpp:8:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    8 |     scanf("%d",&A);
      |     ~~~~~^~~~~~~~~

ソースコード

diff #

#include<stdio.h>
int main()
{
    unsigned char A;
    unsigned char i;
    unsigned short sTotal=0;

    scanf("%d",&A);

    for(i=0;i<=A;i++)
    {
         sTotal+=i;
    }
    printf("%d\n",sTotal);

    return 0;

}
0