diff options
author | Nguyễn Gia Phong <vn.mcsinyx@gmail.com> | 2019-12-15 15:09:13 +0700 |
---|---|---|
committer | Nguyễn Gia Phong <vn.mcsinyx@gmail.com> | 2019-12-15 15:09:13 +0700 |
commit | 9e28e4c7b67c54229df11d355047ac8a88ea1817 (patch) | |
tree | 0d9d40db69613c2c49564a3f1987a005d61f4db3 /NTU/xauduynhat.c | |
parent | 67393f42f41ab92219deb549f711121c4dab845b (diff) | |
download | cp-9e28e4c7b67c54229df11d355047ac8a88ea1817.tar.gz |
Normalize pathname
Diffstat (limited to 'NTU/xauduynhat.c')
-rw-r--r-- | NTU/xauduynhat.c | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/NTU/xauduynhat.c b/NTU/xauduynhat.c deleted file mode 100644 index 4e327a2..0000000 --- a/NTU/xauduynhat.c +++ /dev/null @@ -1,42 +0,0 @@ -#include <stdio.h> -#include <string.h> -#include <ctype.h> - -unsigned short unqlen(char *s) -{ - char up[26] = {}, low[26] = {}, c; - unsigned short i, len = strlen(s); - - for (i = 0; i < len; i++) { - c = s[i]; - if (islower(c)) { - low[c - 97]++; - if (low[c - 97] > 1) - return i; - } else { - up[c - 65]++; - if (up[c - 65] > 1) - return i; - } - } - - return i; -} - -int main() -{ - char s[50000]; - scanf("%s", s); - - unsigned short i, max = 1, val; - - for (i = 0; i < strlen(s) - max; i++) { - val = unqlen(s + i); - if (val > max) - max = val; - } - - printf("%hd\n", max); - - return 0; -} |