글
백준 2753번 윤년(JAVA, C#)
JAVA
import java.util.*;
public class Main{
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
int a;
a = sc.nextInt();
if((a%4) == 0 && (a%100) != 0 || (a%400) == 0)
{
System.out.println("1");
}
else
{
System.out.println("0");
}
}
}
/////////////////////
C#
using System;
namespace Baekjoon {
class Program {
static void Main() {
string s = Console.ReadLine();
int a = int.Parse(s);
if((a%4) == 0 && (a%100) != 0 || (a%400) == 0)
{
Console.WriteLine("1");
}
else
{
Console.WriteLine("0");
}
}
}
}
'백준 프로그래밍' 카테고리의 다른 글
백준 2884번 알람 시계(JAVA, C#) (0) | 2023.02.12 |
---|---|
백준 14681번 사분면(JAVA, C#) (0) | 2023.02.12 |
백준 9498번 시험 성적(JAVA, C#) (0) | 2023.02.12 |
백준 1330번 두 수 비교하기(C#, JAVA) (0) | 2023.02.12 |
백준 25083번 새싹(C#, JAVA) (0) | 2023.02.12 |