Untitled

 avatar
unknown
c_cpp
a year ago
246 B
3
Indexable
#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;
}
Editor is loading...
Leave a Comment