結果

問題 No.1108 移調
ユーザー Maeda
提出日時 2025-03-11 17:55:02
言語 C
(gcc 13.3.0)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 379 bytes
コンパイル時間 157 ms
コンパイル使用メモリ 24,960 KB
実行使用メモリ 7,324 KB
最終ジャッジ日時 2025-03-11 17:55:04
合計ジャッジ時間 1,296 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:5:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    5 |     scanf("%d %d",&n,&h);
      |     ^~~~~~~~~~~~~~~~~~~~
main.c:8:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    8 |         scanf("%d",&numList[i]);
      |         ^~~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h> 

int main() {
    int n,h;
    scanf("%d %d",&n,&h);
    int numList[n];
    for(int i = 0 ; i < n ; i ++){
        scanf("%d",&numList[i]);
        numList[i] += h;
    }
    for(int i = 0 ; i < n ; i ++){
        printf("%d",numList[i]);
        if(i != n-1){
            printf(" ");
        }else{
            printf("\n");
        }
    }
    return 0;
}
0