大家帮忙看看这题做的对不对,谢谢~~
写一个程序接受职员的 name. basic. daper. bonper.loandet 利用下面的关系计算工资:salary=basic+basic*daper/100+bonper* basic/100-loandet
数据为:name basic daper bonper loandet
MARK 2500 55 33.33 250.00
计算工资并将结果输出在下列标题下
Name Basic Salary
#include<stdio.h> void main() {
int basic,daper,loandet; float bonper,salary; char name[20]; basic=2500; daper=55; loandet=250; bonper=33.33f;
printf("输入名字:\n"); printf("输入基本工资:\n");
scanf("%s",&name); scanf("%d",&basic); salary=basic+basic+daper/100+bonper*basic/100-loandet;
printf("工资=%f\n",salary);
} 大家看看这样可以吗?