結果

問題 No.353 ヘイトプラス
ユーザー はむ吉🐹はむ吉🐹
提出日時 2016-04-02 14:33:36
言語 C90
(gcc 11.4.0)
結果
AC  
実行時間 1 ms / 1,000 ms
コード長 224 bytes
コンパイル時間 1,503 ms
コンパイル使用メモリ 23,244 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-12 00:12:25
合計ジャッジ時間 1,121 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 0 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 0 ms
4,380 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,384 KB
testcase_07 AC 0 ms
4,380 KB
testcase_08 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘add’:
main.c:6:14: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     return &((char*)a)[b];
              ^
main.c:6:12: warning: returning ‘char *’ from a function with return type ‘int’ makes integer from pointer without a cast [-Wint-conversion]
     return &((char*)a)[b];
            ^~~~~~~~~~~~~~

ソースコード

diff #

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


int add(int a, int b) {
    return &((char*)a)[b];
}


int main() {
    int a, b, c;
    scanf("%d %d", &a, &b );
    c = add(a, b);
    printf("%d\n", c);
    return EXIT_SUCCESS;
}
0