All pastes #960208 Raw Edit

Mine

public text v1 · immutable
#960208 ·published 2008-03-27 23:14 UTC
rendered paste body
#include <stdio.h>
#include <string.h>

int main()
{
	char word[32] = "";
	printf("type in a word:\n");
	scanf_s("%s", word, sizeof(word));
	char uniques[30] = "";
	int currentunique = 0;
	int wordlength = strlen(word);
	for (int i = 0; i < wordlength; i++)
	{
		char buffer[2];
		buffer[0] = word[i];
		buffer[1] = '\0';
		if (strstr(uniques, buffer) == NULL)
		{
			uniques[currentunique] = word[i];
			uniques[currentunique+1] = '\0';
			currentunique++;
		}
	}

	printf("unique symbols found: %s\n", uniques);

	int numbar = strlen(uniques);
	int numbar2 = strlen(uniques) - 1;
	while (1)
	{
		numbar *= numbar2;
		numbar2--;
		if (numbar2 <= 1) break;
	}

	printf("there are %d permutations in %s", numbar, word);
}