fork download
  1. #include <stdio.h>
  2. void cal (int x, int y, int *sum, int *diff, int *mul, int *mod);
  3.  
  4. int main(void) {
  5. int n1,n2,a,b,c,d;
  6. scanf("%d",&n1);
  7. scanf("%d",&n2);
  8. cal(n1,n2,&a,&b,&c,&d);
  9. printf("sum%d,diff%d,mul%d,mod%d",a,b,c,d);
  10. return 0;
  11. }
  12.  
  13. void cal (int x,int y,int *sum, int *diff, int *mul, int *mod){
  14. *sum=x+y;
  15. *diff=(y>x)?y-x:x-y;
  16. *mul=x*y;
  17. *mod=x/y;
  18. }
Success #stdin #stdout 0s 5276KB
stdin
2 5
stdout
sum7,diff3,mul10,mod0