语法错误,没看出来,怎样提高程序的可读性呢

//1
//程序要求是根据指定的时间和通货膨胀率来给出预算值//
#include
using namespace std;
int main()
{
/*
a是通货膨胀率,b是通货膨胀率转为小数,c是开支,d是预算 , cout是每一年,year是总年份*/
double a;
double b;
double c,year;
double d;
int cout = 0;
cout<<"please input a,c,year,d";
cin>>a>>c>>year>>d;
b=a/100;
cout<<"%a = "<<b<<endl;
while(cout<=year)
{
c=c+c*b*cout;
cout++;
}
cout<<"the budget is "<<d<<endl;
return 0;
}



算法没太看懂,不过从提高程序可读性方面,给你的建议就是变量命名应该有实际意义能望名知意的名称,才便于别人阅读。
你这用字母依次顺序定义变量的方法,实在不可取啊。

错误是因为int cout = 0;楼主敢不敢换个名字,cout是定义在命名空间std中的一个对象
换成int out = 0;就行了,下面的几个也要换一下

 #include<iostream>
using namespace std;

int main()
{
    double a;
    double b;
    double c,year;
    double d;
    int out = 0;
    cout<< "please input a,c,year,d" << endl;
    cin>>a>>c>>year>>d;
    b=a/100;
    cout<<"%a = "<<b<<endl;
    while(out<=year)
    {
        c=c+c*b*out;
        out++;
    }
    cout<<"the budget is "<<d<<endl;
}

//1

//程序要求是根据指定的时间和通货膨胀率来给出预算值//
#include
using namespace std;
int main(){
//a是通货膨胀率,b是通货膨胀率转为小数,c是开支,d是预算 , cout是每一年,year是总年份//
double a;
double b;
double c,year;
double d;
int out = 0;
cout<<"please input a,c,year,d";
cin>>a;
b=a/100;
cout<<"%a = "< cin>>c>>year;
while(out<=year)
{
d=c+c*b*out;
out++;
cout<<"the budget is "<<d<<endl;
}

return 0;
}

//2


已经得到想要的结果了,那请问在程序的可读性方面还需做哪些改进