#include <stdio.h>
void res(int num1,int num2,int *pHe,int *pCha,int *pJi,double *pShang)
{
*pHe=num1+num2;
*pCha=num1-num2;
*pJi=num1*num2;
*pShang=num1/num2;
}
int main(int argc, const char * argv[])
{
int num1=99;
int num2=3;
int he=0;
int cha=0;
int ji=0;
double shang=0.0;
res(99,3,&he,&cha,&ji,&shang);
printf("%d\n%d\n%d\n%.2lf\n",he,cha,ji,shang);
return 0;
}
|
|