文章
8
粉丝
0
获赞
28
访问
1.2k
#include<iostream>
#include<vector>
using namespace std;
// 判断闰年
bool isLeapYear(int year){
return (year % 400 == 0) || (year % 4 == 0 && year % 100 != 0);
}
int main(){
int sampleCount; // 输入的样例个数
vector<int> years;
vector<int> months;
vector<int> days;
vector<int> addDays; // 累加的天数
cin >> sampleCount;
// 保存输入的值,后面再循环处理后进行输出
// 然后后面再一个一个输出,而不是输入一条输出一条,所以要进行保存再读取
for(int i = 0; i < sampleCount; i++){
int yearInput, monthInput, dayInput, daysToAdd;
cin >> yearInput >> monthInput >> dayInput >> daysToAdd;
years.push_back(yearInput);
months.push_back(monthInput);
days.push_back(dayInput);
&nb...
登录后发布评论
暂无评论,来抢沙发