Advertisement
idsystems

CPP_Practica41 - Bisiesto

Jan 30th, 2012
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.53 KB | None | 0 0
  1. // Program: bisiesto.cc
  2. // Author:  Yoan Pinzon
  3. // Date:    Agosto 30, 2006
  4.  
  5. #include <iostream>
  6.  
  7. using namespace std;
  8.  
  9. int main()
  10. {
  11.    int year;
  12.    bool bisiesto;
  13.  
  14.    cout << "A¤o Bisiesto" << endl;
  15.    cout << "============" << endl;
  16.  
  17.    cout << "Entre el a¤o = "; cin >> year;
  18.  
  19.    bisiesto = ( ( year % 4 == 0 && year % 100 != 0 ) || year % 400 == 0 );
  20.  
  21.    if(bisiesto)
  22.    {
  23.       cout << year << " es bisiesto" << endl;
  24.    }
  25.    else
  26.    {
  27.       cout << year << " NO es bisiesto" << endl;
  28.    }
  29.  
  30.    return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement