想要计算从2012年1月22日到某一天过了多少天

想要计算从2012年1月22日到某一天过了多少天但最后说cout有问题,我看不懂,是跟左值右值有关系吗,为什么。

###### #include<iostream>
using namespace std;
int monthDays[13]={-1,31,28,31,30,31,30,31,31,30,31,30,31};//每个月的天数
int main()
{
    int year,month,day,days;
     day =0;
    cin>>year>>month>>day;
    //从2012年每过一年的天数
    for(int y=2012;y<=year;y++){
        if(y%4==0&&y%100!=0||y%400==0)
        days+=366;
        else 
        days+=365;
    }
    //从1月每过一个月的天数
    if(year%4==0&&year%100!=0||year%400==0)
        monthDays[2]=29;
        for(int m=1;m   <month;m++)
        days+=monthDays[m];
        //当日是在22号的前面还是后面
    int d=22;
    if (d<day)
    days=days+day-d;
    else
    days=days-22;

    
    cout>>days>>endl;
    return 0;
         
}

######29 6 C:\Users\Peter\Documents\计算?絰x年?x月xx日需??少??cpp [Error] no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream'} and 'int')
980 5 D:\DEV C++\Dev-Cpp\TDM-GCC-64\lib\gcc\x86_64-w64-mingw32\9.2.0\include\c++\istream [Error] no type named 'type' in 'struct std::enable_if<false, void>'

我的解答思路和尝试过的方法
成功运行程序。

cout>>days>>endl;
修改为
cout<<days<<endl;

cout>>days>>endl;反了,cout<<days<<endl;

###### #include<iostream>
using namespace std;
int monthDays[13]={-1,31,28,31,30,31,30,31,31,30,31,30,31};//每个月的天数
int main()
{
    int year,month,day,days;
     day =0;
    cin>>year>>month>>day;
    //从2012年每过一年的天数
    for(int y=2012;y<=year;y++){
        if(y%4==0&&y%100!=0||y%400==0)
        days+=366;
        else 
        days+=365;
    }
    //从1月每过一个月的天数
    if(year%4==0&&year%100!=0||year%400==0)
        monthDays[2]=29;
        for(int m=1;m   <month;m++)
        days+=monthDays[m];
        //当日是在22号的前面还是后面
    int d=22;
    if (d<day)
    days=days+day-d;
    else
    days=days-22;
 
    
    cout<<days<<endl;
    return 0;
         
}