느낀 및 명 ¶
.. 번 마 받는 부 는. ( 문.)
를 는 명목 따. (.ㅎ)
.. 27 동 더 ... 만들 며, .
리 1 0 를 , 면 모 를 는 .
를 들 7 는 1, 2, ... 7 런 .
배 를 보 명 부듯 덧붙.
를 들 9Set 면..
배1 - 1,2,3,4,5,6,7,8,9
배2 - 1 0 0 0 0 0 0 0 0
1 . 례
배2 - 0 1 0 0 0 0 0 0 0
배2 - 0 0 1 0 0 0 0 0 0
배2 - 0 0 0 1 0 0 0 0 0
배2 - 0 0 0 0 1 0 0 0 0
배2 - 0 0 0 0 0 1 0 0 0
배2 - 0 0 0 0 0 0 1 0 0
배2 - 0 0 0 0 0 0 0 1 0
배2 - 0 0 0 0 0 0 0 0 1
런 .
2 ...를 는 명목 따. (.ㅎ)
.. 27 동 더 ... 만들 며, .
리 1 0 를 , 면 모 를 는 .
를 들 7 는 1, 2, ... 7 런 .
리는 () | |
9 | 0.078 |
10 | 0.172 |
11 | 0.375 |
12 | 0.781 |
를 들 9Set 면..
배1 - 1,2,3,4,5,6,7,8,9
배2 - 1 0 0 0 0 0 0 0 0
1 . 례
배2 - 0 1 0 0 0 0 0 0 0
배2 - 0 0 1 0 0 0 0 0 0
배2 - 0 0 0 1 0 0 0 0 0
배2 - 0 0 0 0 1 0 0 0 0
배2 - 0 0 0 0 0 1 0 0 0
배2 - 0 0 0 0 0 0 1 0 0
배2 - 0 0 0 0 0 0 0 1 0
배2 - 0 0 0 0 0 0 0 0 1
런 .
배2 - 1 1 0 0 0 0 0 0 0
배2 - 1 0 1 0 0 0 0 0 0
배2 - 1 0 0 1 0 0 0 0 0
배2 - 1 0 0 0 1 0 0 0 0
배2 - 1 0 0 0 0 1 0 0 0
배2 - 1 0 0 0 0 0 1 0 0
배2 - 1 0 0 0 0 0 0 1 0
배2 - 1 0 0 0 0 0 0 0 1
배2 - 0 1 1 0 0 0 0 0 0
배2 - 0 1 0 1 0 0 0 0 0
배2 - 0 1 0 0 1 0 0 0 0
배2 - 0 1 0 0 0 1 0 0 0
배2 - 0 1 0 0 0 0 1 0 0
배2 - 0 1 0 0 0 0 0 1 0
배2 - 0 1 0 0 0 0 0 0 1
배2 - 0 0 1 1 0 0 0 0 0
.
.
(략)
런 모 를 낸.^^
문 부 대는 남.^^*
배2 - 1 0 1 0 0 0 0 0 0
배2 - 1 0 0 1 0 0 0 0 0
배2 - 1 0 0 0 1 0 0 0 0
배2 - 1 0 0 0 0 1 0 0 0
배2 - 1 0 0 0 0 0 1 0 0
배2 - 1 0 0 0 0 0 0 1 0
배2 - 1 0 0 0 0 0 0 0 1
배2 - 0 1 1 0 0 0 0 0 0
배2 - 0 1 0 1 0 0 0 0 0
배2 - 0 1 0 0 1 0 0 0 0
배2 - 0 1 0 0 0 1 0 0 0
배2 - 0 1 0 0 0 0 1 0 0
배2 - 0 1 0 0 0 0 0 1 0
배2 - 0 1 0 0 0 0 0 0 1
배2 - 0 0 1 1 0 0 0 0 0
.
.
(략)
런 모 를 낸.^^
문 부 대는 남.^^*
¶
~cpp #include <time.h> #include <stdio.h> #include <iostream> int* input_and_return_number(int*); void process(int*, int); int main() { int time_in; // . ///// int gaesu; int *temp_gaesu=&gaesu; int *numbers=input_and_return_number(&gaesu); ///// time_in = clock(); // . process(numbers,gaesu); free(numbers); printf("CPU CLOCKS = %d\n", clock() - time_in); // 났 - = 램 return 0; // 램 료. } int* input_and_return_number(int *number_gaesu) { printf(" 는?>>"); fflush(stdin); scanf ("%d",number_gaesu); int *numbers=(int*)malloc(sizeof(int)*(*number_gaesu)); for (register int i=0; i<*number_gaesu; ++i) { printf("%d번 를 .>>",i+1); fflush(stdin); scanf("%d",numbers+i); } return numbers; } void process(int *numbers, int gaesu) { int *temp_where=(int*)malloc(sizeof(int)*gaesu); for (register int temp_gaesu=1; temp_gaesu<=gaesu; ++temp_gaesu) { int bun_ja=1; int bun_mo=1; for (register int i=0; i<temp_gaesu; ++i) { bun_ja*=gaesu-i; bun_mo*=i+1; } int combination=bun_ja/bun_mo; for (register int i=0; i<gaesu; ++i) { if (i<temp_gaesu) temp_where[i]=1; else temp_where[i]=0; } for (register int i=0; i<combination; ++i) { printf("{"); int end=gaesu-1; for (register int j=0; j<gaesu; ++j) { if(1==temp_where[j]) printf(" %d ",numbers[j]); } printf("} "); int find_last=end; for (; find_last>=0; --find_last) { if (1==temp_where[find_last]) break; } if (find_last==end) { int gaesu_of_one=0; int find_zero=0; for (register int j=end; j>=0; --j) { if (0==temp_where[j]) find_zero=1; else { temp_where[j]=0; if (0==find_zero) ++gaesu_of_one; else { for (register int k=j+1; k<j+2+gaesu_of_one; ++k ) temp_where[k]=1; break; } } } } else { temp_where[find_last]=0; temp_where[find_last+1]=1; } } } free(temp_where); }