SHARE
TWEET

Untitled

a guest Feb 26th, 2020 80 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <ctype.h>
  3. #include <stdlib.h>
  4. #include <ctype.h>
  5. #include <string.h>
  6.  
  7. typedef struct word {
  8.   int count;
  9.   char *Word;
  10.  } WORD;
  11.  
  12.  int main()
  13. {
  14.     int N=0;
  15.     WORD Vocabulary[300000];
  16.     FILE *I;
  17.     char str[1000] , s[100];
  18.     char filename[256];
  19. printf("Введите название файла:\n ");
  20. scanf("%s", filename);
  21.  
  22. I=fopen(filename,"r");
  23. if (I==0)
  24. {
  25.     printf("Файл %s не удалось открыть! \n",filename);
  26.     exit(0);
  27. }
  28. while (fgets(str, 1000, I)!=NULL)
  29. {
  30.     while(strtok(str, " ,.")!=NULL)
  31.     {
  32.         Vocabulary[N].Word=malloc(strlen(s)+1);;
  33.         strcpy(Vocabulary[N].Word, s);
  34.     printf("%s n", Vocabulary[N].Word);
  35.     N++;
  36. }
  37. }
  38.  
  39.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top