You are viewing a single comment's thread. Return to all comments →
#include <bits/stdc++.h> using namespace std; void Update(int *a, int *b){ int sum = *a + *b; int diff = abs(*a - *b); *a = sum; *b = diff; } int main() { ios_base::sync_with_stdio(0), cin.tie(0); //optimization line int a, b; cin>>a>>b; Update(&a, &b); cout << a << endl << b << endl; return 0; }
Seems like cookies are disabled on this browser, please enable them to open this website
Pointer
You are viewing a single comment's thread. Return to all comments →