• + 8 comments

    A simple and perhaps readable solution.. You can use n instead of temp as its just a dummy..

    int main() 
    {
        int n,temp;
        cin>>temp;
        while(cin>>n)
        {
            if(n<38)
                cout<<n<<endl;
            else if(n%5 >= 3)
                cout<<n+ (5-n%5)<<endl;
            else
                cout<<n<<endl;
    
        }
        return 0;
    }