방명록
- [코드업] 1151_10보다 작은 수2024년 07월 18일 23시 59분 02초에 업로드 된 글입니다.작성자: Le마리
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int num = sc.nextInt(); if (num < 10) { System.out.println("small"); } } }
public static void main(String[] args) { // 10보다 작은 수가 입력되면 small 을 출력, 10이상이면 아무것도 출력하지 마시오. Scanner sc = new Scanner(System.in); System.out.print("숫자를 입력하세요 : "); int num = sc.nextInt(); if (num < 10) { System.out.println("small"); } sc.close(); }
-- 결과 --
'문풀 > 코드업' 카테고리의 다른 글
[코드업] 1080_[기초-종합] 언제까지 더해야 할까? (0) 2024.07.20 [코드업] 1079_원하는 문자가 입력될 때까지 반복 출력하기 (3) 2024.07.20 [코드업] 1152_10보다 작은 수 (else 버전) (1) 2024.07.19 다음글이 없습니다.이전글이 없습니다.댓글