Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <unistd.h>
- #include <string.h>
- #include <stdio.h>
- #include <fcntl.h>
- int main()
- {
- int i, count = 0, isset = 0, fd;
- char arr[1000];
- while ((i = getchar()) != EOF)
- {
- if (i == '\"')
- {
- if (isset == 0) {
- isset = 1;
- arr[0] = '\0';
- count = 0;
- } else {
- arr[count++] = '\0';
- if (strlen(arr) > 3 && strcmp(arr+strlen(arr)-3,"rpm") == 0) {
- printf("%s\n",arr);
- }
- isset = 0;
- }
- }
- else
- {
- if (isset == 1)
- arr[count++] = i;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment