#include<stdio.h> int main(void) { void sum_diff(float op1,float op2,float *psum,float *pdiff); float psum,pdiff; float op1,op2; //用float,用%f; printf("输入op1,op2:"); scanf("%f%f",&op1,&op2); //调用函数; sum_diff(op1,op2,&psum,&pdiff); printf("*psum=%f,*pdiff=%f",psum,pdiff); return 0; } void sum_diff(float op1,float op2,float *psum,float *pdiff) { *psum=op1+op2; *pdiff=op1-op2; }