>>62
たぶんこう

×scanf("%d",&p1);
○scanf("%d",p1);

×printf("%d\n",p1);
○printf("%d\n",*p1);