当先锋百科网

首页 1 2 3 4 5 6 7

cb95edf2785b4867671b121e2b138a0e.png

#include "stdafx.h"

#include

#include

#include

using namespace std;

int main()

{

tm time1;

int n,m, monthday[12] = {31,28,31,30,31,30,31,31,30,31,30,31};

cin >> time1.tm_mon >> time1.tm_mday >> n;

cout << "输入的日期是:"<

m = n;

if (n >= 365)

n = n - 365;

while (1)

{

if (time1.tm_mday + n <= monthday[time1.tm_mon - 1])

{

time1.tm_mday = time1.tm_mday + n;

break;

}

else

{

time1.tm_mday = time1.tm_mday + n - monthday[time1.tm_mon - 1];

time1.tm_mon++;

n = 0;

}

}

cout <

system("pause");

return 0;

}