Advertisement
Guest User

Untitled

a guest
Oct 27th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. int h,q,m,k,j;
  2. if(month == 1)
  3. {
  4. month = 13;
  5. year--;
  6. }
  7. if (month == 2)
  8. {
  9. month = 14;
  10. year--;
  11. }
  12. q = day;
  13. m = month;
  14. k = year % 100;
  15. j = year / 100;
  16. h = q + 13*(m+1)/5 + k + k/4 + j/4 + 5*j;
  17. h = h % 7;
  18. switch(h)
  19. {
  20. case 0 : cout<<"Sambata.\n"; break;
  21. case 1 : cout<<"Duminica.\n"; break;
  22. case 2 : cout<<"Luni. \n"; break;
  23. case 3 : cout<<"Marti. \n"; break;
  24. case 4 : cout<<"Miercuri. \n"; break;
  25. case 5 : cout<<"Joi. \n"; break;
  26. case 6 : cout<<"Vineri. \n"; break;
  27. }
  28. return 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement