Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void LeapYear_Nearly(char* TIME)
- {
- int dem = 0, A[10], B[10];
- int year = Year(TIME);
- int yearT = year;
- while (yearT > 1) {
- yearT--;
- if (LeapYear(yearT) == 1) {
- /*cout << yearT;*/
- for (int i = 0; i < 2; i++)
- {
- A[i] = yearT;
- }
- dem += 1;
- if (dem == 2) break;
- }
- }
- yearT = year;
- dem = 0;
- while (1) {
- yearT++;
- if (LeapYear(yearT) == 1) {
- /*cout << yearT;*/
- for (int i = 0; i < 2; i++)
- {
- B[i] = yearT;
- }
- dem += 1;
- if (dem == 2) break;
- }
- }
- for (int i = 0; i < 2; i++)
- {
- for (int j = 0; j < 2; j++)
- {
- if (year - A[i] < B[j] - year) // int year=Year(TIME)
- cout << A[i];
- else
- cout << B[j];
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement