#include<stdio.h>
void main()
{
int x;
void opposition(int); /*函数声明*/
printf(“请输入一个整数:”);
scanf("%d",&x);
printf(“调用函数前:x=%d\n”,x);
opposition(x); /*调用函数oppsition求相反数*/
printf("调用函数后:x=%d\n",x);
}
void opposition(int a)
{
a=-a; /*使用变量自身存储其相反数*/
printf("该整数的相反数是:a=%d\n",a);
}