Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main () {
- int jour;
- int mois;
- int annee;
- int x;
- int y;
- cout << "Tapez votre annee\n";
- cin >> annee;
- cout << "Tapez votre jour\n ";
- cin >> jour;
- cout << "Tapez votre mois\n";
- cin >> mois;
- // Comment here
- if ( (annee % 4 == 0) && (annee % 100 != 0) ) {
- x = annee;
- }
- else {
- y = annee;
- }
- // Comment here
- if ( mois == 2 && annee == y) {
- jour <= 28 ;
- }
- else {
- cout << "Date non valide \n ";
- }
- // Comment here
- if ( mois == 2 && x == annee ) {
- jour <= 29;
- }
- else {
- cout << "Date non valide \n ";
- }
- // Comment here
- if ( mois == 1 || mois == 3 || mois == 5 || mois == 7 || mois == 8 || mois == 10 || mois == 12) {
- jour <= 31;
- }
- else {
- cout << "Date non valide";
- }
- // Comment here
- if ( mois == 11 || mois == 6|| mois == 9|| mois == 4 ) {
- jour <= 30 ;
- }
- else {
- cout << " Date non valide";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement