2 solutions

  • 1
    @ 2025-4-7 18:16:06
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
        int n;
        cin>>n;
        int t=n%10;
        if(t==0||t==1||t==2)
        {
            cout<<n-t;
        }
        if(t==3||t==4||t==5||t==6||t==7)
        {
            cout<<n+(5-t);
        }
        if(t==8||t==9)
        {
            cout<<n+(10-t);
        }
        return 0;
    }
    

    Information

    ID
    2322
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    1
    Tags
    (None)
    # Submissions
    52
    Accepted
    28
    Uploaded By