C语言程序编写(希望大神帮忙做下谢啦!)

编程题目1、编写完整程序实现如下功能:输入一个整数,判断它能否被3,5,7整除。(
编程题目 2、假定征税的办法如下:收入在800元以下(含800元)的不征税;收入在800元以上,1200元以下者,超过800元的部分按5%收税;收入在1200元以上, 2000元以下者,超过1200元的部分按8%收税;收入在2000元以上者,2000元以上部分按按20%的税率收税,试编写按收入计算税费的程序。
编程题目3、while循环结构编程练习--编写程序解决如下问题,假定2012年中国人口为13.39724852亿,如果以每年1.4%的速度增长,多少年后中国人口达到或超过20亿。
编程题目4、编写程序,求累加和1+2+3+…..+n.并输出,n由用户输入
编程题目5、实验题目4 while循环结构编程练习——计算需要存款多少年定期存款本金和利息利之和才达到额定数额500000。要求银行定期存款的年利率由用户输入,年利率用变量rate存放;存款本金由用户输入,本金用变量capital存放,单位为元;用户输入打算存款的时间(以年为单位),用变量n存放存款年限,试编程计算多少年后年后的本金和利息之和达到500000元,本金和利息之和用变量deposit存放。如果用户一次性存款超过了500000元,输出“你已是一次性存款超过50万的大客户”和用户输入的存款年限到期后的本金和利息之和。

编程1
void main()
{
int n;
printf("请输入一个整数:");
scanf("%d",&n);
if(n%3==0&&n%5==0&&n%7==0)
printf("\n此数能被3,5,7整除\n");
else
printf("\n此数不能被3,5,7整除\n");
}
编程2#include "stdio.h"
void main()
{
long income;
double fee=0.;
printf("input income:");
scanf("%ld",&income);
if(income>2000)
{
fee+=(income-2000)*.2;
income=2000;
}
switch((income/400))
{
case 5:
case 4:
case 3:
fee+=(income-1200)*.08;
income=1200;
case 2:
fee+=(income-800)*.05;
default:
fee+=0.;
}
printf("tax fee is %.2lf.\n",fee);}编程4#include <stdio.h>
#include <stdlib.h>
void main() {
int n, i;
printf("请输入n:");
scanf("%d", &n);
int sum = 0;
for(i=1; i<=n; i++) sum += i;
printf("和是: %d\n", sum);
}追问

大神,还有编程题5啊,谢啦!

追答

#include
void main()
{
#define M 500000
int capital,n;
int i=0,j=0;
double rate,deposit;
printf("请输入本金:");
scanf("%d",&capital);
printf("请输入存入年数:");
scanf("%d",&n);
printf("请输入年利率:");
scanf("%lf",&rate);
deposit=capital;
while(i=M)
{
printf("你已是一次性存款超过50万的大客户\n");
printf("你存%d年后本息之和是%0.2lf\n",n,deposit);
}
else
{
while(capital<M)
{
capital+=capital*rate;
j++;
}
printf("你存%d年后本息之和是%0.2lf\n",n,deposit);
printf("你要想本息超过50万需要存%d年\n",j);
}
}

温馨提示:答案为网友推荐,仅供参考
相似回答