fork download
  1. #include <stdio.h>
  2.  
  3. int is_uruu(int year){
  4. if(year%400==0){
  5. return 1;
  6. }else if(year%100==0){
  7. }else if(year%4==0){
  8. return 1;
  9. }
  10. return 0;
  11. }
  12.  
  13. int main(void) {
  14. int nenn;
  15. scanf("%d",&nenn);
  16. if (is_uruu(nenn)==0){
  17. printf("うるう年ではない");
  18. }else{
  19. printf("うるう年");
  20. }
  21. return 0;
  22. }
  23.  
Success #stdin #stdout 0s 5308KB
stdin
300
stdout
うるう年ではない