Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- #include <string.h>
- int main(int argc, char * argv[]) {
- int boolean = 0;
- int c = getchar();
- char word[1000];
- int count = 0;
- int fileword = 0;
- int filearray[1000];
- do {
- if ((c >= 97 && c <= 122) || (c >= 65 && c <= 90) || (c == 39)) {
- word[count] = c;
- word[count+1] = '\0';
- count = count + 1;
- }
- else {
- if (count != '\0') {
- boolean = 0;
- for (fileword = 1; fileword < argc; fileword++) {
- if (boolean == 0) {
- if (strcmp(word, argv[fileword]) == 0) {
- printf("CENSORED");
- boolean = 1;
- }
- else if (strcmp(word, argv[fileword]) != 0) {
- boolean = 0;
- }
- }
- }
- if (boolean == 0) {
- printf("%s", word);
- }
- count = '\0';
- }
- putchar(c);
- }
- c = getchar();
- } while (c != EOF);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement