CPP   111

txt compare

Guest on 6th June 2022 01:14:42 AM

  1. #include<stdio.h>
  2. #include<string.h>
  3. char k[10000][50],l[50];
  4. int main()
  5. {
  6.         int a,b;
  7.         freopen("1.txt","r",stdin);
  8.         a=0;
  9.         while(gets(k[a]))
  10.         {
  11.                 a++;
  12.         }
  13.         freopen("2.txt","r",stdin);
  14.         freopen("3.txt","w",stdout);
  15.         b=0;
  16.         while(gets(l))
  17.         {
  18.                 printf("%d -> %d\n",b,strcmp(l,k[b]));
  19.                 b++;
  20.         }
  21.         return 0;
  22. }

Raw Paste


Login or Register to edit or fork this paste. It's free.