12 条题解

  • -1
    @ 2022-1-23 14:11:43
    #include <iostream>
    #include <iomanip>
    using namespace std;
    char a[5];
    int main(){
        long double n,m;
        cin>>n>>a[0]>>m;
        if(a[0]=='+')
            cout<<fixed<<setprecision(2)<<n+m;
        else if(a[0]=='-')
            cout<<fixed<<setprecision(2)<<n-m;
        else if(a[0]=='*')
            cout<<fixed<<setprecision(2)<<n*m;
        else{
            if(m==0){
                cout<<"No Answer.";
                return 0;
            }
            cout<<fixed<<setprecision(2)<<n/m;
        }
        return 0;
    }

    信息

    ID
    859
    时间
    1000ms
    内存
    128MiB
    难度
    8
    标签
    递交数
    2020
    已通过
    358
    上传者