2 solutions

  • 1
    @ 2025-10-29 11:14:11
    #include<iostream>
    #include<iomanip>//用于格式化输出(如控制小数位数)的头文件
    using namespace std;
    int main(){
        double a;
        cin>>a;
        //fixed:以固定小数位数形式输出浮点数;
        //setprecision(3)设置输出的小数位数为3位
        cout<<fixed<<setprecision(3)<<a<<endl;;
        return 0;
    }
    
    • 0
      @ 2026-1-6 13:34:31

      #include <bits/stdc++.h> using namespace std;

      int main() { double a; cin >> a; printf("%.3lf", a); return 0; }

      • 1

      Information

      ID
      304
      Time
      1000ms
      Memory
      64MiB
      Difficulty
      4
      Tags
      # Submissions
      593
      Accepted
      253
      Uploaded By