BlueBook

p307ex9: Leap Year

Given T (1 ≤ T ≤ 10000) non-negative year values, where each year Y is 0 ≤ Y ≤ 1000000, determine whether or not each one is a leap year.

Remember: A year is a leap year if it is divisible by 4 but not by 100 or if it is divisible by 400. 0 is considered a leap year.

Input

Line 1: A single integer representing the number of test cases (years to be entered)
Next T lines: Each year value

Output

Lines 1..T: one integer "1" or "0" denoting whether N is a leap year. Output "1" if N is a leap year, and "0" otherwise.

Sample Input

4
0
4
100
400

Sample Output

1
1
0
1

All Submissions
Best Solutions


Point Value: 3
Time Limit: 2.00s
Memory Limit: 16M
Added: Oct 27, 2008

Languages Allowed:
C++03, PAS, C, HASK, ASM, RUBY, PYTH2, JAVA, PHP, SCM, CAML, PERL, C#, C++11, PYTH3

Comments (Search)

Why is the result of my submission
Compile failed

/var/jail/safeplace/122018.java/p307ex9.java:10: cannot find symbol
symbol : variable num0
location: class p307ex9
(line in my code)
^
1 error

Currently, occurrences of strings like "%­1­0" in source codes and comments are somehow stripped.
This is a known bug that has to be fixed. For now, changing:
num%­1­00
to
num % 100
should circumvent the bug and make your submission accepted.

thanks, got it to work.