Advertisement
Guest User

Untitled

a guest
Jan 18th, 2020
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.55 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int  i,j,m,a,jf,mf,af,maz;
  4. int main()
  5. {
  6. cout<<"donne un date premier"<<endl;
  7.     cin>>j>>m>>a;
  8. cout<<"donne un date final"<<endl;
  9. cin>>jf>>mf>>af;
  10. if(m==1||m==3||m==5||m==7||m==8||m==10||m==12){
  11.     maz=31;
  12.     }else if(m==4||m==6||m==9||m==11){
  13.         maz=30;
  14.         }else if (m=2){
  15.             if (a%4==0){
  16.                 maz=29;
  17.                
  18.             }
  19.             else
  20.             maz=28;
  21.         }
  22.    
  23.     i=-1;
  24.     while (j<=jf&& m<=mf&& a<=af){
  25.     j=j+1;
  26.     if (j>maz){
  27.         m=m+1;
  28.         j=1;
  29.     }
  30.     if (m>12){
  31.         a=a+1;
  32.         m=1;
  33.         j=1;
  34.     }
  35.     i=i+1;
  36. }
  37.     cout<<i;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement