Advertisement
Guest User

Untitled

a guest
Oct 1st, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.16 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main () {
  6.    
  7.     int     jour;
  8.     int     mois;
  9.     int     annee;
  10.     int     x;
  11.     int     y;
  12.    
  13.     cout    << "Tapez votre annee\n";
  14.     cin     >> annee;
  15.    
  16.     cout    << "Tapez votre jour\n ";
  17.     cin     >> jour;
  18.    
  19.     cout    << "Tapez votre mois\n";
  20.     cin     >> mois;
  21.  
  22.     // Comment here
  23.     if ( (annee % 4 == 0) && (annee % 100 != 0) ) {
  24.         x = annee;
  25.     }
  26.     else {
  27.         y = annee;
  28.     }
  29.  
  30.     // Comment here
  31.     if ( mois == 2 && annee == y) {
  32.         jour <= 28 ;
  33.     }
  34.     else {
  35.         cout << "Date non valide \n ";
  36.     }
  37.  
  38.     // Comment here
  39.     if ( mois == 2 && x == annee ) {
  40.         jour <= 29;
  41.     }
  42.     else {
  43.         cout << "Date non valide \n ";
  44.     }
  45.  
  46.     // Comment here
  47.     if ( mois == 1 || mois == 3 || mois == 5 || mois == 7 || mois == 8 || mois == 10 || mois == 12) {
  48.         jour <= 31;
  49.     }
  50.     else {
  51.         cout << "Date non valide";
  52.     }
  53.  
  54.     // Comment here
  55.     if ( mois == 11 || mois == 6|| mois == 9|| mois == 4 ) {
  56.         jour <= 30 ;
  57.     }
  58.     else {
  59.         cout << " Date non valide";
  60.     }
  61.    
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement