Advertisement
ahamed210

v_j2

Nov 30th, 2020
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.44 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6.     FILE *fp1, *fp2;
  7.     double a, b;
  8.  
  9.     fp1 = fopen("expectedoutput.txt", "r");
  10.     fp2 = fopen("output.txt", "r");
  11.  
  12.     while(fscanf(fp1, "%lf", &a) != EOF)
  13.     {
  14.         fscanf(fp2, "%lf", &b);
  15.         if(a!=b){
  16.         printf("WORNG ANS!!!!!! TRY AGAIN\n");
  17.         return 0;
  18.         }
  19.     }
  20.     printf("ACCEPTED!!\n");
  21.  
  22.     fclose(fp1);
  23.     fclose(fp2);
  24.     return 0;
  25. }
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement