C-study/07/1/1.c

18 lines
322 B
C
Raw Normal View History

2021-12-06 13:15:31 +00:00
#include<stdio.h>
void calculate(double x,double y,double *he,double *cha,double *ji,double *shang){
*he=x+y;
*cha=x-y;
*ji=x*y;
*shang=x/y;
}
int main(){
double x,y,he,cha,ji,shang;
scanf("%lf %lf",&x,&y);
calculate(x,y,&he,&cha,&ji,&shang);
printf("%g %g %g %g",he,cha,ji,shang);
return 0;
}