Recap - Till 120
Coddy Java 여정의 기초 섹션에 포함된 레슨 — 73개 중 36번째.
챌린지
초급사용자의 나이를 입력으로 받는 프로그램을 작성하세요.
프로그램은 120까지 남은 years till 120 수를 출력(인쇄)합니다 (아래에 표시된 특정 형식으로).
예를 들어, 입력 25에 대해 예상 출력은 "95 years till 120"입니다.
다른 것은 아무것도 출력하지 마세요!
직접 해보기
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
// 아래에 코드를 작성하세요
}
}기초의 모든 레슨
4Operators Part 1
Arithmetic OperatorsModulo OperatorIncrement/DecrementPost Increment/DecrementArithmetic ShortcutsComparison OperatorsString Comparison5Operators Part 2
Logical Operators Part 1Logical Operators Part 2Recap - Simple LogicLogical Operators Part 3Logical Operators Part 43Variables Part 2
ConstantsNaming ConventionsRecap - Initialize VariablesType Casting Part 1Type Casting Part 26Decision Making
If StatementIf - ElseSwitch StatementTernary OperatorRecap - If ElseNested If - Else