#include < iostream > 
#include < cstdio >
#include < cmath >
#include < algorithm >
using namespace std;
int main()
{
    int t,yr1,mn1,dd1,x,y,z;
    int yr2,mn2,dd2,p,q,r,total_day,day,i,j;
    cin>>yr1>>mn1>>dd1>>t;
    if((yr1%4==0 && yr1%100!=0 && yr1%400==0) && mn1==11){
        y=mn1*31;
    }
    else if(1<=mn1 && mn1<=5){
         y=mn1*31;
    }
     else if(6<=mn1 && mn1<=12){
             y=mn1*30;
     }
     x=y+dd1;
     while(t--){
        cin>>yr2>>mn2>>dd2;
        if((yr2%4==0 &&  yr2%100!=0 && yr2%400==0 )&& mn2==11){
        p=mn1*31;
    }
    else if(1<=mn2 && mn2<=5){
         p=mn2*31;
    }
     else if(6<=mn2 && mn2<=12){
             p=mn2*30;
     }
     for(i=yr1; i<=yr2; i++){
        if(i%4==0 &&  i%100!=0 && i%400==0 )
            j++;
     }
     x=p+dd2;
     z=(yr1-yr2)+j;
     q=y-x;
     day=z*365;
     total_day=day+q;
     cout<<total_day<<endl;
     }
    return 0;
}

asked 10 Mar '17, 11:51

junaki's gravatar image

junaki
212

edited 13 Mar '17, 08:40

menon's gravatar image

menon
4.7k335


প্রথম ভুল কেন y=mn1*31? প্রথম ৫ মাসের জন্য ৩১ র বাকি গুলার জন্য ৩0 দিয়ে গুন।

permanent link

answered 13 Mar '17, 19:24

Nazmul%20H%20Pranto's gravatar image

Nazmul H Pranto
2819

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×63
×7

question asked: 10 Mar '17, 11:51

question was seen: 589 times

last updated: 13 Mar '17, 19:24