Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int h,q,m,k,j;
- if(month == 1)
- {
- month = 13;
- year--;
- }
- if (month == 2)
- {
- month = 14;
- year--;
- }
- q = day;
- m = month;
- k = year % 100;
- j = year / 100;
- h = q + 13*(m+1)/5 + k + k/4 + j/4 + 5*j;
- h = h % 7;
- switch(h)
- {
- case 0 : cout<<"Sambata.\n"; break;
- case 1 : cout<<"Duminica.\n"; break;
- case 2 : cout<<"Luni. \n"; break;
- case 3 : cout<<"Marti. \n"; break;
- case 4 : cout<<"Miercuri. \n"; break;
- case 5 : cout<<"Joi. \n"; break;
- case 6 : cout<<"Vineri. \n"; break;
- }
- return 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement