SHARE
TWEET

Untitled

a guest Apr 25th, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void LeapYear_Nearly(char* TIME)
  2. {
  3.     int dem = 0, A[10], B[10];
  4.     int year = Year(TIME);
  5.     int yearT = year;
  6.     while (yearT > 1) {
  7.         yearT--;
  8.         if (LeapYear(yearT) == 1) {
  9.             /*cout << yearT;*/
  10.             for (int i = 0; i < 2; i++)
  11.             {
  12.                 A[i] = yearT;
  13.             }
  14.             dem += 1;
  15.             if (dem == 2) break;
  16.         }
  17.     }
  18.     yearT = year;
  19.     dem = 0;
  20.     while (1) {
  21.         yearT++;
  22.         if (LeapYear(yearT) == 1) {
  23.             /*cout << yearT;*/
  24.             for (int i = 0; i < 2; i++)
  25.             {
  26.                 B[i] = yearT;
  27.             }
  28.             dem += 1;
  29.             if (dem == 2) break;
  30.         }
  31.     }
  32.     for (int i = 0; i < 2; i++)
  33.     {
  34.         for (int j = 0; j < 2; j++)
  35.         {
  36.             if (year - A[i] < B[j] - year) // int year=Year(TIME)
  37.                 cout << A[i];
  38.             else
  39.                 cout << B[j];
  40.         }
  41.     }
  42. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top