This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <stdlib.h> | |
| int *read(int); | |
| int oria(int,int); | |
| int readx(); | |
| int ready(); | |
| int oriay(int,int); | |
| void printc(int *); | |
| int poscomb(int); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void print(int *A, int N) | |
| { | |
| int i; | |
| for ( i = 0 ; i < N ; i++) | |
| printf("%d ", *(A + i); | |
| printf("\n"); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| for (j = 1; j <= n; j++) { | |
| for (i = 0; i < n-1; i++) { | |
| temp = num[i]; | |
| num[i] = num[i+1]; | |
| num[i+1] = temp; | |
| print(num, n); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from itertools import permutations | |
| comb = permutations([1, 2, 3], 3) | |
| for i in comb: | |
| print(i) |
NewerOlder