fork download
  1. #include <stdio.h>//第0講演習 3-0
  2.  
  3. int is_uruu(int year){
  4. if(year%4==0){
  5. if(year%100==0){
  6. if(year%400==0){
  7. return 1;
  8. }
  9. else return 0;
  10. }
  11. else {
  12. return 1;
  13. }
  14. }
  15. else{
  16. return 0;
  17. }
  18. }
  19. int main() {
  20. int a,y;
  21. scanf("%d",&y);
  22. a=is_uruu(y);
  23. if(a==1)
  24. printf("うるう年である");
  25. else if(a==0)
  26. printf("うるう年でない");
  27. return 0;
  28. }
  29.  
Success #stdin #stdout 0.01s 5320KB
stdin
2026
stdout
うるう年でない