Computer Science/C++
백준 C++ | #0 BOJ2753(윤년) C++ 풀이
토마토.
2022. 7. 27. 14:33
#include <iostream>
#include <string>
int is_yoon(int year) {
if ((year % 100 != 0) && (year % 4 == 0)) {
return 1;
}
else if (year % 400 == 0) {
return 1;
}
else {
return 0;
}
}
int main() {
int year;
std::cin >> year;
std::cout << is_yoon(year) << std::endl;
return 0;
}