fork download
  1. #include <stdio.h>
  2. void cal(int x,int y,int *sum,int *def,int *mul,int *mod);
  3. int main(void)
  4. {
  5. int x,y,a,b,c,d;
  6. scanf("%d",&x);
  7. scanf("%d",&y);
  8.  
  9. cal(x,y,&a,&b,&c,&d);
  10.  
  11. printf("sum:%d def:%d mul:%d mod:%d\n",a,b,c,d);
  12. return 0;
  13. }
  14. void cal(int x,int y,int *sum,int *def,int *mul,int *mod)
  15. {
  16. *sum=x+y;
  17. *def=x>y?x-y:y-x;
  18. *mul=x*y;
  19. *mod=x/y;
  20. }
Success #stdin #stdout 0.01s 5280KB
stdin
Standard input is empty
stdout
sum:-557115396 def:557180924 mul:-791306240 mod:-17004