#include <iostream>
#include <string>
#include <iomanip> //用于保留小数位数

using namespace std;

int main()
{
    int N;
    cin >> N;
    for (int i = 0; i < N; i++)
    {
        string name;
        float base_salary, float_salary, expend;
        cin >> name >> base_salary >> float_salary >> expend;
        float real_salary = base_salary + float_salary - expend;
        cout << name << " " << fixed << setprecision(2) << real_salary << endl; //保留两位小数输出
    }
    return 0;
}

原文地址: https://www.cveoy.top/t/topic/bfnR 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录