fork download
  1.  
  2. #include <stdio.h>
  3.  
  4. void cal(int x, int y, int *sum, int *diff, int *mul, int *mod);
  5.  
  6. int main(void) {
  7. int x, y, sum, diff, mul, mod;
  8. scanf("%d,%d",&x,&y);
  9.  
  10. cal(x, y, &sum, &diff, &mul, &mod);
  11.  
  12. printf("%d, %d, %d, %d, %d, %d",x, y, sum, diff, mul, mod);
  13.  
  14. return 0;
  15. }
  16.  
  17. void cal(int x, int y, int *sum, int *diff, int *mul, int *mod)
  18. {
  19. *sum=x+y;
  20. if(x>=y){
  21. *diff=x-y;}
  22. else *diff=y-x;
  23. *mul=x*y;
  24. *mod=x%y;
  25.  
  26. }
Success #stdin #stdout 0s 5320KB
stdin
1,2
stdout
1, 2, 3, 1, 2, 1