#include <stdio.h>
#include <string.h>
#include <ctype.h>
//结构体
struct employee{
char name[10];//姓名长度小于10
float base_salary;//基本工资
float float_salary;//浮动工资
float expenditure;//支出
};
int main(){
int n;
scanf("%d",&n);
struct employee emp[n];//声明一个结构体数组
//输入
for(int i=0;i<n;i++){
//在C语言中,数组名本身就是一个指针常量,代表着数组首元素的地址。
//emp[i].name是一个字符数组,所以name代表了数组的首地址,这里就不用再加&了。
scanf("%s %f %f %f",
emp[i].name,&emp[i].base_salary,
&emp[i].float_salary,&emp[i].expenditure);
}
//计算
for(int i=0;i<n;i++){
float total = emp[i].base_salary+emp[i].float_salary-emp[i].expenditure;
printf("%s %.2f\n",emp[i].name,total);
}
return 0;
}