Untitled

mail@pastecode.io avatar
unknown
c_cpp
2 months ago
246 B
0
Indexable
Never
#include <iostream>
using namespace std;
int main() 
{
    int N, b, c;
    cin >> N;
    if (N < 0 || N > 127)
    {
        cout << "NO";
        return 0;
    }
    b = N % 2;
    c = (N << 1) | b;
    cout << c;
    return 0;
}
Leave a Comment