第一题:给你个连接函数,链表自己去创建
void (list *head1, list *head2) //两个参数:两个链表的头结点指针。
{
list *temp = head1;
while(temp->next)
temp = temp->next;
temp->next = head2;
}
第二题:可复制粘贴(C语言)
#include
int main(void)
{
double profit = 0;
printf("请输入公司利润:");
scanf("%lf",&profit);
double bonus = 0;
double bonus_1 = 100000 * 0.1;
double bonus1_2 = bonus_1 + (profit - 100000) * 0.075;
double bonus2_4 = bonus1_2 + (profit - 200000) * 0.05;
double bonus4_6 = bonus2_4 + (profit - 400000) * 0.03;
double bonus6_10 = bonus4_6 + (profit - 600000) * 0.015;
double bonus10_ = bonus6_10 + (profit - 1000000) * 0.01;
if(profit <= 10000)
bonus = profit * 0.1;
else if(profit > 100000 && profit <= 200000)
bonus = bonus1_2;
else if(profit > 200000 && profit <= 400000)
bonus = bonus2_4;
else if(profit > 400000 && profit <= 600000)
bonus = bonus4_6;
else if(profit > 600000 && profit <= 1000000)
bonus = bonus6_10;
else if(profit > 1000000)
bonus = bonus10_;
printf("奖金:%lf\n",bonus);
return 0;
}