Add tags

Add tags to the following comment
閏年なら1を、平年なら0を返します☆
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
#include<stdio.h>
int isleapyear(int y){
  int i = y * 0.01;
  return !(y == i * 100 ? i & 3 : y & 3);
}
int main(void){
  printf("%d\n", isleapyear(1900));
  printf("%d\n", isleapyear(2000));
  printf("%d\n", isleapyear(2008));
  printf("%d\n", isleapyear(2100));
  return 0;
}

Add tags

The input will be splited to tags with space.

Index

Feed

Other

Link

Pathtraq

loading...