View Code of Problem 81

#include<iostream>
#include<bits/stdc++.h>
#include<string.h>
using namespace std;

int main(){
	
	int yue[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	int y,m,d;
	cin>>y>>m>>d;
	if((y%4==0&&y%100!=0)||y%400==0){
		yue[2]=29;
	}
	int num=0;
	for(int i=1;i<m;i++){
		num+=yue[i];
	}
	num+=d;
	cout<<num<<endl;
	
	return 0;
		
}

Double click to view unformatted code.


Back to problem 81