C
#include <stdbool.h>
bool IsIsogram(char *str) {
for (int i=0; str[i]; i++) {
for (int k=i+1; str[k]; k++) {
if ( tolower(str[i]) == tolower(str[k]) ) return false;
}
}
return true;
}
#include <stdbool.h>
#include <limits.h>
bool IsIsogram(const char *s)
{
char tab[SCHAR_MAX] = { 0 };
int c;
while (c = *s++)
if (tab[tolower(c)]++) return false;
return true;
}
#include <stdbool.h>
bool IsIsogram(char *str)
{
bool table[26] = {0};
while(*str) {
char c = tolower(*str)-'a';
if( table[c] ) return false;
table[c] = true;
str++;
}
return true;
}
같이 보기