小白又来了 不知道哪里出错了,大大帮帮我
程序#include<stdio.h>
int main(void)
#define MH 1.1 //工资涨幅
#define OY 1.15 //单数年房价涨幅
#define EY 1.18 //双数年房价涨幅
/*程序猿是否有可能买得起房,是道德的沦丧还是。。。。 */
{
float Money,SUM,PAY; //AS=annual salary年薪 ,SUM=总存款,PAY=房价首付
int year;
Money=20,SUM=0,PAY=200*0.3;
printf(" People always keep a little hope for themselves. It's not too late to look down.\n\n");
sleep(3);
printf(" Well, I hope you keep typing after you look at the data.\n\n");
printf(" The unit of measure is W*RMB\n\n");
for(year=1; year<31; year++) //30年内,每年
{
sleep(1);
Money=Money*MH; //+工资
SUM=SUM+Money; //总存款
if(year%2 == 1) //单数年份 ,房价上涨
PAY=PAY*OY;
else //双数年份 ,房价上涨
PAY=PAY*EY;
printf("The difference is %d\n\n",PAY-SUM); //每年打印总存款和房价首付差额
}
printf("In the end,the down payment on house price is %d,you deposit is %d",PAY,SUM);
return 0;
}
最主要的是 得不到想要的 房价和存款差值