Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int i,j,m,a,jf,mf,af,maz;
- int main()
- {
- cout<<"donne un date premier"<<endl;
- cin>>j>>m>>a;
- cout<<"donne un date final"<<endl;
- cin>>jf>>mf>>af;
- if(m==1||m==3||m==5||m==7||m==8||m==10||m==12){
- maz=31;
- }else if(m==4||m==6||m==9||m==11){
- maz=30;
- }else if (m=2){
- if (a%4==0){
- maz=29;
- }
- else
- maz=28;
- }
- i=-1;
- while (j<=jf&& m<=mf&& a<=af){
- j=j+1;
- if (j>maz){
- m=m+1;
- j=1;
- }
- if (m>12){
- a=a+1;
- m=1;
- j=1;
- }
- i=i+1;
- }
- cout<<i;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement