fork download
  1. #include <stdio.h>
  2.  
  3. void cal(int x, int y, int *sum, int *diff, int *mul, int *mod);
  4.  
  5. int main() {
  6. int x,y,sum, diff, mul, mod;
  7. scanf("%d", &x);printf("x:");
  8. scanf("%d", &y);printf("y:");
  9.  
  10. cal(x, y, &sum, &diff, &mul, &mod);
  11.  
  12. printf("Sum: %d\n", sum);
  13. printf("diff: %d\n", diff);
  14. printf("mul: %d\n", mul);
  15. printf("mod: %d\n", mod);
  16.  
  17. return 0;
  18. }
  19.  
  20. void cal(int x, int y, int *sum, int *diff, int *mul, int *mod) {
  21. *sum = x + y;
  22. *diff=(x>y)?(x-y):(y-x);
  23. *mul = x * y;
  24. *mod = x / y;
  25. }
  26.  
Success #stdin #stdout 0s 5280KB
stdin
Standard input is empty
stdout
x:y:Sum: 405182573
diff: 405138771
mul: 21443936
mod: 18499