Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Define and Initialize Variables //
- // Assign Values to Each Weekday //
- enum weekdays { Monday, // Value of 0 //
- Tuesday, // Value of 1 //
- Wednesday, // Value of 2 //
- Thursday, // Value of 3 //
- Friday, // Value of 4 //
- Saturday, // Value of 5 //
- Sunday }; // Value of 6 //
- weekdays today; // Establish variable 'today' in weekdays enumeration //
- today = Tuesday; // Set the first day of the year //
- int d = 0 ; // Days //
- int m = 0; // Months //
- // Main Program //
- while (m < 12)
- {
- m = m + 1;
- if (m == 1 || m == 3 || m == 5 || m == 7 || m == 8 || m == 10 || m == 12)
- {
- while (d < 31)
- {
- d = d + 1;
- static_cast <int> (today);
- int today;
- today = today + 1;
- if (d == 7 && today == Monday)
- {
- cout << m << "/" << d;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement