1 条题解

  • 0
    @ 2023-6-11 12:16:44

    C++ :

    #include<bits/stdc++.h>
    using namespace std;
    int main(){
      string s1,s2,s3;
      cin>>s1>>s2>>s3;
      s1 = s1.substr(0,s1.length() - 1);
      s2 = s2.substr(0,s2.length() - 1);
      s3 = s3.substr(0,s3.length() - 1);
      cout<<fixed<<setprecision(1)<<80 * atoi(s1.c_str()) / 100.0 <<endl;
      cout<<fixed<<setprecision(1)<<80 * atoi(s2.c_str()) / 100.0 <<endl;
      cout<<fixed<<setprecision(1)<<80 * atoi(s3.c_str()) / 100.0 <<endl;
      cout<<fixed<<setprecision(1)<<80 * (100 - atoi(s1.c_str()) -atoi(s2.c_str()) -atoi(s3.c_str())  )/ 100.0 <<endl;
    } 
    
    

    Python :

    a,s=[input().split(),0]
    for i in a:
        print(round(int(i[:-1])/100*80,1),end=' ')
        s+=int(i[:-1])
    print(round((100-s)/100*80,1))
    
    
    • 1

    信息

    ID
    2263
    时间
    1000ms
    内存
    16MiB
    难度
    (无)
    标签
    递交数
    0
    已通过
    0
    上传者