90分(@o@)蒻智求解

B2088 计算书费

lwz_18616560722 @ 2024-11-30 09:51:43

#include <iostream>
using namespace std;

int main(){
    int a,b,c,d,e,f,g,h,i,j;
    cin>>a>>b>>c>>d>>e>>f>>g>>h>>i>>j;
    cout<<a*28.9+b*32.7+c*45.6+d*78+e*35+f*86.2+g*27.8+h*43+i*56+j*65;
}

by guxiaoqing @ 2024-11-30 09:57:30

include <iostream>

using namespace std;

int main(){ int a,b,c,d,e,f,g,h,i,j; cin>>a>>b>>c>>d>>e>>f>>g>>h>>i>>j; printf("%.1f",a28.9+b32.7+c45.6+d78+e35+f86.2+g27.8+h43+i56+j65); }

#include <iostream>
using namespace std;

int main(){
    int a,b,c,d,e,f,g,h,i,j;
    cin>>a>>b>>c>>d>>e>>f>>g>>h>>i>>j;
    printf("%.1f",a*28.9+b*32.7+c*45.6+d*78+e*35+f*86.2+g*27.8+h*43+i*56+j*65);
}

by guxiaoqing @ 2024-11-30 09:58:13

因为题目说了“保留一位小数” 所以要用printf


by lwz_18616560722 @ 2024-11-30 13:05:54

谢谢


by lwz_18616560722 @ 2024-11-30 13:06:36

已关


|