์ ๋ชฉ์ ๋งํฌ๋ฅผ ์ ๋ ฅํ๋ฉด ํด๋น ๋ฌธ์ ๋ก ์ด๋ํฉ๋๋ค.
1 | 1330 | ๋ ์ ๋น๊ตํ๊ธฐ | Java |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int A = scan.nextInt();
int B = scan.nextInt();
if(A >B)
System.out.println(">");
if(A<B)
System.out.println("<");
if(A==B)
System.out.println("==");
}
}
2 | 9498 | ์ํ ์ฑ์ | Java |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int A = scan.nextInt();
if(A>89)
System.out.println("A");
else if(79<A && A<90)
System.out.println("B");
else if(69<A && A <80)
System.out.println("C");
else if(59<A && A < 70)
System.out.println("D");
else
System.out.println("F");
scan.close();
}
}
3 | 2753 | ์ค๋ | Java |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int year = scan.nextInt();
if(year%4==0 && (year%100!=0 || year %400 ==0))
System.out.println("1");
else
System.out.println("0");
scan.close();
}
}
4 | 14681 | ์ฌ๋ถ๋ฉด ๊ณ ๋ฅด๊ธฐ | Java |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int x = scan.nextInt();
int y = scan.nextInt();
if(x>0 && y>0)
System.out.println("1");
else if(x<0 && y>0)
System.out.println("2");
else if(x<0 && y<0)
System.out.println("3");
else if(x>0 && y<0)
System.out.println("4");
else
System.out.println("error");
scan.close();
}
}
5 | 2884 | ์๋ ์๊ณ | Java |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int hour = scan.nextInt();
int minute = scan.nextInt();
if(minute - 45 <0) {
hour -= 1;
if(hour<0)
hour = 23;
minute = 60 +(minute -45);
}
else minute -= 45;
System.out.print(hour + " ");
System.out.print(minute);
scan.close();
}
}
728x90
๋ฐ์ํ