Obliczanie dnia roku od daty

Muszę obliczyć numer dnia danej daty. Rok ma 366 dni. Każdy miesiąc ma jednak inną wartość i muszę przypisać wartości. Czy jest to szybszy sposób, niż sposób, w jaki to robię?

#include<iostream>
using namespace std;
int main()
{
   int day, month, year, dayNumber;

   cout<< "Please enter the month, by numerical value:";
   cin>> month;
   cout<<"Please enter the day, by numerical value:";
   cin>> day;
   cout<<"Please enter the year, by numerical value:";
   cin>> year;
   if (month == 1)
   {
      dayNumber= day;
      cout<< "Month;" << '\t'<< month << '\n'
          << "Day:"<<'\t'<< day<< '\n'
          << "Year:"<<'\t'<< year<<'\n'
          << "Day Number:"<< '\t'<< dayNumber<< endl;
   }
   else if(month==2)
   {
      dayNumber= day+31; 
   }
}

questionAnswers(6)

yourAnswerToTheQuestion