Codeforces Round #591 (Div. 2, based on Technocup 2020 Elimination Round 1) A

https://codeforces.com/contest/1241/problem/A

#include 
using namespace std;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int q,n;
    cin>>q;
    while(q--)
    {
        cin>>n;
        if(n<=4)
        {
            cout<<4-n<<"\n";
        }
        else
        {
            if(n%2)
                cout<<"1\n";
            else
                cout<<"0\n";
        }
    }
    return 0;
}

你可能感兴趣的:(cf)