4620원을 천원·오백원·백원·십원 단위로 분리하는 빈칸 (a)~(d)를 채우시오.
사용 가능: 변수 m, 연산자 /, %, 정수 1000, 500, 100, 10
public class Problem {
public static void main(String[] args) {
int m = 4620;
int a = ( ); // 천원짜리
int b = ( ); // 오백원짜리
int c = ( ); // 백원짜리
int d = ( ); // 십원짜리
System.out.println(a); // 4
System.out.println(b); // 1
System.out.println(c); // 1
System.out.println(d); // 2
}
}이 문제는 풀이 화면에서 직접 실행해 풀 수 있어요.
꿈라CBT