fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main(){
  5. int a;
  6. cin>>a;
  7. if( a%100==0){
  8. if(a%400==0)
  9. cout<<"leap year";
  10.  
  11. else
  12. cout<<"not leap year";
  13. }
  14. else{
  15. if(a%4==0)
  16. cout<<"Leap year";
  17. else
  18. cout<<"not leap yr";
  19. }
  20. return 0;
  21. }
Success #stdin #stdout 0.01s 5272KB
stdin
2004
stdout
Leap year