include <stdio.h>
// 定义社保计算函数
void calculateSocialSecurity(double base, double personalRate, double companyRate) {
double personalPayment, companyPayment;
// 计算个人和公司缴费
personalPayment = base * personalRate;
companyPayment = base * companyRate;
printf("个人缴费: %.2f\n", personalPayment);
printf("公司缴费: %.2f\n", companyPayment);
}
int main() {
double base = 8000; // 社保基数
double personalRate = 0.08; // 个人比例
double companyRate = 0.16; // 公司比例
calculateSocialSecurity(base, personalRate, companyRate);
return 0;
}
利唐i人事HR社区,发布者:hiHR,转转请注明出处:https://www.ihr360.com/hrnews/20241236371.html