最新消息: 电脑我帮您提供丰富的电脑知识,编程学习,软件下载,win7系统下载。

心碎的图案怎么用c语言编出来,这个C语言程序怎么写?

IT培训 admin 3浏览 0评论

心碎的图案怎么用c语言编出来,这个C语言程序怎么写?

满意答案

女人ta让人心碎

2013.04.07

采纳率:43%    等级:9

已帮助:1867人

#include

float ticheng(float lilun){

float tc=0;

if (lilun<=10){

tc=lilun*0.1;

return tc;

}

if(lilun<=20){

tc = (lilun-10)*0.075;

lilun-=10;

}else if(lilun<=40){

tc = (lilun-10)*0.05;

lilun-=20;

}else if(lilun<=60){

tc = (lilun-10)*0.05;

lilun-=40;

}else if(lilun<=100){

tc = (lilun-10)*0.03;

lilun-=60;

}else if(lilun>100){

tc = (lilun-10)*0.015;

lilun-=100;

}

return tc+ticheng(lilun);

}

main(){

int lilun;

printf("\nLi Lun(Wang yuan)=");

scanf("%d",&lilun);

printf("\nTiCheng=%.2f",ticheng(lilun)*10000);

getch();

}

00分享举报

心碎的图案怎么用c语言编出来,这个C语言程序怎么写?

满意答案

女人ta让人心碎

2013.04.07

采纳率:43%    等级:9

已帮助:1867人

#include

float ticheng(float lilun){

float tc=0;

if (lilun<=10){

tc=lilun*0.1;

return tc;

}

if(lilun<=20){

tc = (lilun-10)*0.075;

lilun-=10;

}else if(lilun<=40){

tc = (lilun-10)*0.05;

lilun-=20;

}else if(lilun<=60){

tc = (lilun-10)*0.05;

lilun-=40;

}else if(lilun<=100){

tc = (lilun-10)*0.03;

lilun-=60;

}else if(lilun>100){

tc = (lilun-10)*0.015;

lilun-=100;

}

return tc+ticheng(lilun);

}

main(){

int lilun;

printf("\nLi Lun(Wang yuan)=");

scanf("%d",&lilun);

printf("\nTiCheng=%.2f",ticheng(lilun)*10000);

getch();

}

00分享举报

发布评论

评论列表 (0)

  1. 暂无评论