Advertisement
Guest User

Сравнение файлов

a guest
Mar 19th, 2017
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.87 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. #include <locale.h>
  5. #include <conio.h>
  6.  
  7. int main()
  8. {
  9.     int stroka = 0;
  10.     char ch_1[20], ch_2[20];
  11.     FILE *file_1;
  12.     FILE *file_2;
  13.  
  14.     setlocale(LC_ALL, "russian");
  15.  
  16.     if((file_1 = fopen("1.txt","r")) == NULL)
  17.     {   printf("Ошибка ебать");  return 1;   }
  18.  
  19.     if((file_2 = fopen("2.txt","r")) == NULL)
  20.     {   printf("Нету файла блять");   return 1;   }
  21.  
  22. int x;
  23. int y;
  24.  
  25.     while(!feof(file_1) && !feof(file_2))
  26.     {
  27.         for (x=0; x < 200; x++)
  28.         {
  29.         fgets(ch_1[x], 20, file_1);
  30.            
  31.         for (y=0; y < 5; y++)
  32.         {
  33.         fgets(ch_2[y], 20, file_2);
  34.        
  35.         if (ch_1[x]==ch_2[y])
  36.         printf("\n Строка №%d совпадает \n",stroka);
  37.         else
  38.                 printf(".");
  39.         stroka++;
  40.    
  41.         }
  42.     }
  43.     }
  44.     getch();
  45.     fclose (file_1);
  46.     fclose (file_2);
  47.     printf("\nЗакончил ебать\n");
  48.    
  49. return 0;
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement