Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- #include <stdlib.h>
- #include <math.h>
- int main(int argc, char**argv)
- {
- FILE*f;
- f = fopen(argv[1], "r");
- char file_string[100];
- int counter;
- while(1)
- {
- fgets(file_string, 100, f);
- counter = 0;
- for (int i = 0; i < (int)strlen(file_string); i++)
- if (file_string[i] == ' ')
- counter++;
- if (counter < 3)
- printf("%s", file_string);
- if (feof(f))
- break;
- }
- fclose(f);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement