Advertisement
Guest User

Untitled

a guest
May 6th, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <fstream>
  3. #include <cstring>
  4.  
  5. using namespace std;
  6.  
  7. ifstream fin("date.in");
  8. ifstream fin2("date.out");
  9.  
  10. char s1[10000], s2[10000];
  11. int k, p;
  12.  
  13. int main()
  14. {
  15.     while (fin != NULL)
  16.     {
  17.         fin.getline(s1, 10000);
  18.         fin2.getline(s2, 10000);
  19.         p++;
  20.         if (!strcmp(s1, s2))
  21.         {
  22.             k++;
  23.         }
  24.         else
  25.         {
  26.             cout << p << " " << s1;
  27.             cout << " - RAU  ";
  28.             cout << s2;
  29.             cout << endl;
  30.         }
  31.     }
  32.     if (k == p)
  33.     {
  34.         cout << " 10 cu STELUTA!";
  35.     }else
  36.     {
  37.         cout << " Ai facut bine " << k << " / " << p;
  38.     }
  39.     return 0;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement