7 solutions

  • 3
    @ 2025-7-3 15:28:16
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
        double x;
        cin>>x;
        int t=round(x);
        cout<<t;
        return 0;
    }
    
    • 2
      @ 2025-12-6 9:32:24

      #include<bits/stdc++.h> using namespace std; int main() { double x; cin>>x; int t=round(x); cout<<t; return 0; }

      • 2
        @ 2025-9-13 16:18:22
        
        include<bits/stdc++.h>
        using namespace std
        int main()
        {
        	double n;
        	cin>>a;
        	int t=round(n);
        	cout<<"1";
        }
        • 0
          @ 2026-10-28 16:47:51
          #include <bits/stdc++.h>
          #include <cmath>
          using namespace std;
          
          int main()
          {
              double x;
              cin>>x;
              //方法一:纯数学四舍五入思想
               if((x-0.5)>=int(x)){
                  cout<<int(x)+1<<endl;
              }
              else{
                  cout<<int(x)<<endl;
              }
              //方法二:cmath函数
              // cout<<round(x)<<endl;
              return 0;
          }
          
          • 0
            @ 2025-2-23 16:21:50
            ```cpp
            #include<bits/stdc++.h>
            using namespace std;
            int main()
            {
                double n;
                cin>>n;
                int t=round(n);
                cout<<t;
                return 0;
            }
            
            
            • -1
              @ 2026-7-24 11:41:39
              
              include<bits/stdc++.h>
              using namespace std
              int main()
              {
              	double n;
              	cin>>a;
              	int t=round(n);
              	cout<<"1";
              }
              • -2
                @ 2025-9-13 16:16:51
                #include<bits/stdc++.h>
                using namespace std;
                int main()
                {
                	double n;
                	cin>>n;
                	int t=round(n);
                	cout<<t;
                }
                • 1

                Information

                ID
                2295
                Time
                1000ms
                Memory
                256MiB
                Difficulty
                1
                Tags
                (None)
                # Submissions
                176
                Accepted
                100
                Uploaded By