2 solutions

  • 4
    @ 2025-3-8 16:22:53
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
        int a;
        cin>>a;
        int res=a/5;
        if(a%5>=3)
        {
            res++;
        }
        cout<<res*5;
        return 0;
    }
    
    
    • 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;
      }
      
      • 1

      Information

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