1 solutions

  • 0
    @ 2025-7-12 16:26:10

    #include using namespace std;

    int main() { int i = 0, n, m = 0, a; cin >> n; for (a = m; a <= n; a++) { if (a % 2 != 0) i += a; else

    		m += a;
    }
    
    
    cout << m << " " << i ;
    return 0;
    

    }

    • 1

    Information

    ID
    173
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    3
    Tags
    # Submissions
    87
    Accepted
    47
    Uploaded By