less than 1 minute read

백준 4673: 셀프 넘버

문제 내용 & 필기

내가 쓴 정답 코드

class Test3 {
    public void d() {
    	int c;
    	for(int D=1; D<10000; D++) {
    		c = 0;
    		for(int N = 0; N<D; N++) {
    			if( N + (N/1000%10) + (N/100%10) + (N/10%10) + (N%10) == D ) { c=1; }
    		}
    		if(c==0) { System.out.println(D); }
    	}
    }
}


public class class10 {

	public static void main(String[] args) {

		Test3 test3 = new Test3();
		test3.d();

	}

}

Categories:

Updated: