函式

 avatar
user_3763047219
c_cpp
3 years ago
400 B
3
Indexable
#include <stdio.h>
#define _CRT_SECURE_NO_WARNING
#include <ctype.h>
#include <assert.h>
#include <stdbool.h>

bool leap_year(int y) {
	bool is_leap = (y % 400 == 0) || (y % 4 == 0 && y % 100 != 0);
	return is_leap;
}

void main()
{
	int year;
	scanf_s("%d", &year);
	assert(year > 0);

	bool result = leap_year(year);

	if (result)
		printf("Yes\n");
	else
		printf("No\n");
}
Editor is loading...