#include <stdio.h>
int main() {
int arr[3] = {1, 2, 3};
int *p = arr; // 配列の先頭アドレスをポインタに代入
// 配列とポインタの操作例
printf("arr[0] の値: %d\n", arr
[0]); printf("p[0] の値: %d\n", p
[0]); // p は arr の先頭要素を指すので同じ printf("*(p + 1) の値: %d\n", *(p
+ 1)); // 配列の 2 番目の要素
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgbWFpbigpIHsKICAgIGludCBhcnJbM10gPSB7MSwgMiwgM307CiAgICBpbnQgKnAgPSBhcnI7ICAvLyDphY3liJfjga7lhYjpoK3jgqLjg4njg6zjgrnjgpLjg53jgqTjg7Pjgr/jgavku6PlhaUKCiAgICAvLyDphY3liJfjgajjg53jgqTjg7Pjgr/jga7mk43kvZzkvosKICAgIHByaW50ZigiYXJyWzBdIOOBruWApDogJWRcbiIsIGFyclswXSk7CiAgICBwcmludGYoInBbMF0g44Gu5YCkOiAlZFxuIiwgcFswXSk7ICAvLyBwIOOBryBhcnIg44Gu5YWI6aCt6KaB57Sg44KS5oyH44GZ44Gu44Gn5ZCM44GYCiAgICBwcmludGYoIioocCArIDEpIOOBruWApDogJWRcbiIsICoocCArIDEpKTsgIC8vIOmFjeWIl+OBriAyIOeVquebruOBruimgee0oAoKICAgIHJldHVybiAwOwp9Cg==