Advertisement
Guest User

Untitled

a guest
Feb 24th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3. #include <string.h>
  4.  
  5. int main(int argc, char * argv[]) {
  6.  
  7. int boolean = 0;
  8. int c = getchar();
  9. char word[1000];
  10. int count = 0;
  11. int fileword = 0;
  12. int filearray[1000];
  13.  
  14. do {
  15. if ((c >= 97 && c <= 122) || (c >= 65 && c <= 90) || (c == 39)) {
  16. word[count] = c;
  17. word[count+1] = '\0';
  18. count = count + 1;
  19. }
  20. else {
  21. if (count != '\0') {
  22. boolean = 0;
  23. for (fileword = 1; fileword < argc; fileword++) {
  24. if (boolean == 0) {
  25. if (strcmp(word, argv[fileword]) == 0) {
  26. printf("CENSORED");
  27. boolean = 1;
  28. }
  29. else if (strcmp(word, argv[fileword]) != 0) {
  30. boolean = 0;
  31. }
  32. }
  33. }
  34. if (boolean == 0) {
  35. printf("%s", word);
  36. }
  37. count = '\0';
  38. }
  39. putchar(c);
  40. }
  41. c = getchar();
  42. } while (c != EOF);
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement