• Source
    1. #include <stdio.h>
    2.  
    3. void update(int *a,int *b) {
    4. // Complete this function
    5. int tempa=*a;
    6. int tempb=*b;
    7. *a=tempa+tempb;
    8. *b=tempa-tempb;
    9. if( *b<0){
    10. (*b) *=-1;
    11. }
    12. }
    13.  
    14. int main() {
    15. int a, b;
    16. int *pa = &a, *pb = &b;
    17.  
    18. scanf("%d %d", &a, &b);
    19. update(pa, pb);
    20. printf("%d\n%d", a, b);
    21.  
    22. return 0;
    23. }
    24.