В общем задали задачу. Вроде бы легко, но вот застряла программа в раёне условия (оно здесь одно), выводит пустоту :( Подскажите в чём ошибся :)
#include <stdio.h>
#include <string.h>
int main(int argc, char **argv)
{
	typedef char byte;
	char str[7];
	char tmp[7];
	char res[36][7];
	int x;
	byte cnt;
	const byte d [] = {	1, 2, 3,
						1, 3, 2,
						2, 1, 3,
						2, 3, 1,
						3, 1, 2,
						3, 2, 1 };
	
	const byte l [] = {	0, 4, 5,
						0, 5, 4,
						4, 0, 5,
						4, 5, 0,
						5, 0, 4,
						5, 4, 0 };
	FILE *fi, *fo;
	fi = fopen("input.txt", "r");
	fo = fopen("output.txt", "w");
	fscanf(fi, "%s", str);
	for(int i=0; i<6; i++)
		for(int j=0; j<6; j++)
		{
			tmp[0] = str[l[3*i]];
			tmp[1] = str[d[3*j]];
			tmp[2] = str[d[3*j+1]];
			tmp[3] = str[d[3*j+2]];
			tmp[4] = str[l[3*i+1]];
			tmp[5] = str[l[3*i+2]];
			tmp[6] = '\0';
			//fprintf(fo, "%s %s", tmp, "\n");
			for(int k=0; k<cnt; k++)
				if( strcoll(tmp, (const char *)&res[]) || cnt == 0)
				{
					strcpy((char *)&res[cnt], (const char *)&tmp);
					cnt++;
				}
		}
	
	for(int i=0; i<cnt; i++)
		fprintf(fo, "%s %s", res[i], "\n");
	fclose(fi);
	fclose(fo);
	return 0;
}






