3 solutions

  • 1
    @ 2025-7-8 10:28:28
    #include<bits/stdc++.h> 
    using namespace std;
    int main()
    {
        int n;
        cin>>n;
        for(int i=1;i<=n;i++)
        {
            if(i%2==0) cout<<i<<' ';
        }
        return 0;
    }
    

    Information

    ID
    45
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    1
    Tags
    (None)
    # Submissions
    205
    Accepted
    76
    Uploaded By