Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<string.h>
  3. #include<ctype.h>
  4.  
  5. int main() {
  6. char string[60] = "";
  7. int arrASCII[255] = {0}
  8.  
  9. for(int i = 0; i < 255; i++) {
  10. arrASCII[i] = 0;
  11. } //tao ta mang 255 so 0;
  12. printf("Enter string: ");
  13. gets(string);
  14. strlwr(string);//viet thuong het 1 chuoi
  15.  
  16. int length = strlen(string);
  17. for(int i=0; i < length; i++) {
  18. arrASCI[string[i]]++;
  19. }
  20. printf("Found characters: \n");
  21. for(int i= 0; i < 255; i++) {
  22. if(arrASCI[i] ==1) {
  23. printf("%c\t", i);
  24. }
  25. }
  26. free(string);
  27. free(arrASCII);
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement