Advertisement
myloyo

2.10

Nov 5th, 2022 (edited)
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.17 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. int f(int &x) {
  5.     if (x % 2 == 0) {
  6.         x = x / 2;
  7.     }
  8.     else x = 0;
  9. }
  10. int main()
  11. {
  12.     int i;
  13.     cin >> i;
  14.     f(i);
  15.     cout << i;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement