Advertisement
duehoa1211

Untitled

Sep 19th, 2014
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.38 KB | None | 0 0
  1. bool leapYear(int n)
  2. {
  3.     if(n%100==0){
  4.         if(n%4==0 && n%400==0)
  5.             return true;
  6.         else return false;}
  7.     else
  8.     {
  9.         if(n%4==0)
  10.             return true;
  11.         else return false;
  12.     }
  13. }
  14. int main()
  15. {
  16.     int n;
  17.     cout<<"N:";cin>>n;
  18.     if(leapYear(n)==true)
  19.         cout<<"Nam Nhuan";
  20.     else
  21.         cout<<"Khong phai nam nhuan";
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement