错在哪里?#include #include using namespace std;void ResetTheTime(int *year,int *month,int *date,int *hour,int *minute,int *second){int dayOfMonth[12]={31,28,31,30,31,30,31,31,30,31,30,31};if( *year < 0 || *month < 1 ||*month > 12 ||*date < 1 || *
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/25 23:31:44
错在哪里?#include #include using namespace std;void ResetTheTime(int *year,int *month,int *date,int *hour,int *minute,int *second){int dayOfMonth[12]={31,28,31,30,31,30,31,31,30,31,30,31};if( *year < 0 || *month < 1 ||*month > 12 ||*date < 1 || *
错在哪里?
#include
#include
using namespace std;
void ResetTheTime(int *year,int *month,
int *date,int *hour,int *minute,
int *second)
{
int dayOfMonth[12]={31,28,31,30,31,30,
31,31,30,31,30,31};
if( *year < 0 || *month < 1 ||
*month > 12 ||
*date < 1 || *date > 31 || *hour
< 0 || *hour > 23 ||
*minute < 0 ||*minute > 59|| *second
60 )
return;
if( *year < 0 || *month < 1 ||
*month > 12 )
if( *year%400 == 0 || *year%100 =
0 && *year%4 == 0 )
dayOfMonth[1] = 29;
*second += 1;
if(*second >= 60)
{
*second = 0;
*minute += 1;
if(*minute >= 60)
{
*minute = 0;
*hour += 1;
if(*hour >= 24)
{
*hour = 0;
*date += 1;
if(*date > dayOfMonth
[*month-1])
{
*date = 1;
*month += 1;
if(*month > 12)
{
*month=1;
*year += 1;
}
}
}
}
}
cout
错在哪里?#include #include using namespace std;void ResetTheTime(int *year,int *month,int *date,int *hour,int *minute,int *second){int dayOfMonth[12]={31,28,31,30,31,30,31,31,30,31,30,31};if( *year < 0 || *month < 1 ||*month > 12 ||*date < 1 || *
#include
#include
using namespace std;
void ResetTheTime(int *year,int *month,
int *date,int *hour,int *minute,
int *second)
{
int dayOfMonth[12]={31,28,31,30,31,30,
31,31,30,31,30,31};
if( *year < 0 || *month < 1 ||
*month > 12 ||
*date < 1 || *date > 31 || *hour
< 0 || *hour > 23 ||
*minute < 0 ||*minute > 59|| *second
60 )
return;
if( *year < 0 || *month < 1 ||
*month > 12 )
if( *year%400 == 0 || *year%100 !=
0 && *year%4 == 0 )
dayOfMonth[1] = 29;
*second += 1;
if(*second >= 60)
{
*second = 0;
*minute += 1;
if(*minute >= 60)
{
*minute = 0;
*hour += 1;
if(*hour >= 24)
{
*hour = 0;
*date += 1;
if(*date > dayOfMonth
[*month-1])
{
*date = 1;
*month += 1;
if(*month > 12)
{
*month=1;
*year += 1;
}
}
}
}
}
cout