Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <string>
- #include <stdio.h>
- #include <vector>
- #pragma warning(disable : 4996)
- using namespace std;
- namespace year
- {
- const char* monthes[15] = {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"};
- vector<int> days = { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
- int nowyear;
- }
- using namespace year;
- //////////////////////////////////////////
- int main()
- {
- bool visc = false;
- printf("enter year : ");
- scanf("%d", &nowyear);
- if(nowyear % 4 == 0)
- {
- days[1] = 28;
- visc = true;
- }
- for(int i = 0; i < 12; i++)
- {
- printf("%10s has %d days\n", monthes[i], days[i]);
- }
- if (visc) printf("-----------------------\nFebruary destructor works. ");
- else printf("-----------------------\nFebruary destructor doesnt work.");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement