1
0
mirror of https://github.com/renbaoshuo/202401-programming-assignments.git synced 2024-12-16 15:44:39 +00:00
202401-programming-assignments/【实践课内】16.结构体2/7-1 计算职工工资.c

23 lines
369 B
C

#include <stdio.h>
struct person {
char name[10];
double basic, floating, outlay;
};
int n;
int main() {
scanf("%d", &n);
for (int i = 1; i <= n; i++) {
struct person p;
scanf("%s %lf %lf %lf", p.name, &p.basic, &p.floating, &p.outlay);
printf("%s %.2lf\n", p.name, p.basic + p.floating - p.outlay);
}
return 0;
}