bor

Lena: Next even

bor
Jul 10th, 2013
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.21 KB | None | 0 0
  1. #include <iostream>
  2. #include <algorithm>
  3. using namespace std;
  4.  
  5. int main() {
  6.   int n;
  7.   cin >> n;
  8.   if (n % 2 == 0) {
  9.     n = n + 2;
  10.   } else {
  11.     n = n + 1;
  12.   }
  13.   cout << n << endl;
  14.   return 0;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment