진법변환 문제.


<코드>

1
2
3
4
5
6
7
8
9
10
11
12
13
#include <stdio.h>
 
int a[] = { 10,12,16 };
 
int main() {
    for (int i = 1000; i < 10000; i++) {
        int c[3= { 0, };
        for (int j = 0; j < 3; j++for (int temp = i; temp > 0; temp /= a[j]) 
            c[j] += temp%a[j];
        if (c[0== c[1&& c[0== c[2]) printf("%d\n", i);
    }
    return 0;
}
cs


'BOJ' 카테고리의 다른 글

8068 Water  (0) 2017.10.03
7579 앱  (0) 2017.10.03
2959 거북이  (0) 2017.10.03
1874 스택수열  (0) 2017.10.03
1992 쿼드트리  (0) 2017.10.03

+ Recent posts