dykow

6

Mar 27th, 2018
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.56 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <cstdlib>
  4.  
  5. using namespace std;
  6.  
  7. int i=0, j=0;
  8.  
  9. int main()
  10. {
  11.     ifstream myfile("dane.txt");
  12.     if(!myfile.good() && !myfile.open())  {cout << "Fuck!"; exit(0);}
  13.  
  14.     int numbers[320], counter=0;
  15.     while(myfile >> numbers[i]){
  16.         if(i==319){
  17.             for(j=0; j<320; j++){
  18.                 if(numbers[j] != numbers[319-j])
  19.                     {counter++; break;}
  20.             }
  21.             i=0;
  22.         }else
  23.             i++;
  24.     }
  25.  
  26.     cout << counter;
  27.  
  28.     myfile.close();
  29.     return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment