Leap Year

Lab C Beginner 10 points

Read a year and print leap or common.

Input

One integer.

Output

One word.

Example

Input

2024

Output

leap
Sample input available Sample output available
Editor
C

Hints

&& is and, || is or.

Solution explanation

Century years are leap years only when divisible by 400.

Show solution
#include <stdio.h>

int main() {
    int y;
    scanf("%d", &y);
    if ((y % 4 == 0 && y % 100 != 0) || y % 400 == 0) {
        printf("leap\n");
    } else {
        printf("common\n");
    }
    return 0;
}
Output
Answer
HOME LEARN COMMUNITY DASHBOARD