Created
February 18, 2017 17:20
-
-
Save Adals20/a70ed6493c5f7157259da90ef32c9373 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
main (){ | |
int anno; | |
cout << "Introduce un año de 4 dijitos para saber si es bisiesto: "; | |
cin >> anno; | |
if (anno < 1752) | |
cout << "No hay años bisiestos antes de 1752" << endl; | |
else if (anno%4 == 0 && (anno%100 != 0 || anno%400==0)) | |
cout << "\nEl año " << anno << " es un año bisiesto"; | |
else | |
cout << "\nEl año " << anno << " NO es un año bisiesto"; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment