Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while(1) {
- if(voc[0] == n + 1) break;
- print();
- for(int i = m-1;i>0;i--){
- while(voc[i] < voc[i-1] - 1){
- voc[i]++;
- if(i != m - 1){ voc[m - 1] = 1;
- for(int j = m-2;j>i;j--)
- voc[j] = voc[j+1]+1;
- }
- i = m -1;
- print();
- }
- }
- voc[0]++;
- voc[m-1] = 1;
- for(int i=m-2;i>0;i--)
- voc[i] = voc[i+1] + 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement