fork download
  1. #include <stdio.h>
  2. #include <cmath>
  3.  
  4. void update(int *a,int *b) {
  5. int num1 = *a;
  6. int num2 = *b;
  7. *a = num1 + num2;
  8. *b = std::abs(num1 - num2);
  9. }
  10.  
  11. int main() {
  12. int a, b;
  13. int *pa = &a, *pb = &b;
  14.  
  15. scanf("%d %d", &a, &b);
  16. update(pa, pb);
  17. printf("%d\n%d", a, b);
  18.  
  19. return 0;
  20. }
Success #stdin #stdout 0s 15232KB
stdin
Standard input is empty
stdout
0
0