• + 0 comments
    void update(int* a, int* b);
    
    int main() {
        /* Enter your code here. Read input from STDIN. Print output to STDOUT */   
        int a,b;
        std::cin >> a >> b;
        update(&a, &b);
        std::cout << a << std::endl;
        std::cout << b << std::endl;
        return 0;
    }
    
    void update(int* a, int* b)
    {
        int tempA = *a;
        int tempB = *b;
        
        *a = tempA+tempB;
        *b = abs(tempA - tempB);
    }