void main(){
double num,rate=0.00417,sum=0
int i
scanf("%lf",&num)
while(num<=0){
scanf("%lf",&num)
}
for(i=1i<=5i++){
sum=((100+sum)*(1+rate))
}
printf("%.3f\n",sum)
}
#include <stdio.h>#include <stdlib.h>
void main(void)
{
double money,bouns
printf("input the money, input a negitive number to leave:")
do{
scanf("%lf",&money)
if(money<=100000) bouns=money*0.1
else if(money<=200000) bouns=(money-100000)*0.075+100000*0.1
else if(money<=400000) bouns=(money-200000)*0.05+100000*0.075+100000*0.1
else if(money<=600000) bouns=(money-400000)*0.03+200000*0.05+100000*0.075+100000*0.1
else if(money<=1000000) bouns=(money-600000)*0.015+200000*0.03+200000*0.05+100000*0.075+100000*0.1
else if(money>100000) bouns=(money-1000000)*0.01+400000*0.015+200000*0.03+200000*0.05+100000*0.075+100000*0.1
printf("bouns is %.2lf\n",bouns)
}
while(money>=0)
}
#include <stdio.h>
#include <stdlib.h>
void main(void)
{
double money,bouns
int temp
printf("input the money, input a negitive number to leave:")
do{
scanf("%lf",&money)
temp=money/100000
switch(temp)
{
case 0: bouns=money*0.1break
case 1: bouns=(money-100000)*0.075+100000*0.1break
case 2:
case 3: bouns=(money-200000)*0.05+100000*0.075+100000*0.1break
case 4:
case 5: bouns=(money-400000)*0.03+200000*0.05+100000*0.075+100000*0.1break
case 6:
case 7:
case 8:
case 9: bouns=(money-600000)*0.015+200000*0.03+200000*0.05+100000*0.075+100000*0.1break
default: bouns=(money-1000000)*0.01+400000*0.015+200000*0.03+200000*0.05+100000*0.075+100000*0.1
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)