Advertisement
Guest User

Untitled

a guest
Dec 10th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.60 KB | None | 0 0
  1. #include <stdlib.h>
  2. #include <stdio.h>
  3. #include <locale.h>
  4. #include <string.h>
  5. #include <Windows.h>
  6.  
  7. int main()
  8. {
  9.     setlocale(LC_ALL, "Russian");
  10.     SetConsoleCP(1251);
  11.     SetConsoleOutputCP(1251);
  12.  
  13.     char* str1[80] = {"я съел женю"};
  14.     char* str2[80] = {"я съел влада"};
  15.     char* str3[80];
  16.     int i = 0, j = 0, k = 0;
  17.     int temp;
  18.     for (i = 0, k = 0; str1[i] != '\0'; ++i)
  19.  
  20.     {
  21.         for (j = 0; str2[j] != '\0'; ++j)
  22.         {
  23.             temp = strncmp(str1[i], str2[j], 80);
  24.             if (temp == 0)
  25.             {
  26.                 str3[k] = str1[i];
  27.                 ++k;
  28.             }
  29.         }
  30.     }
  31.  
  32.  
  33.     puts(str3);
  34.  
  35.     system("pause");
  36.     return 0;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement