2 条题解

  • 1
    @ 2024-5-5 9:53:45

    这道题我个人觉得用printf更好用,但cout也不是不可以,我两种方法都写一遍吧

    printf(法1):

    #include<bits/stdc++.h>
    using namespace std;	
    double a,b;
    int main(){
        cin>>a>>b;
        printf("%0.8lf",a/b);
    }
    

    cout(法2):

    #include<bits/stdc++.h>
    using namespace std;	
    double a,b;
    int main(){
        cin>>a>>b
        cout<<fixed<<setprecision(8)<<a/b;
    }
    

    信息

    ID
    2
    时间
    1000ms
    内存
    64MiB
    难度
    10
    标签
    递交数
    7
    已通过
    4
    上传者