Advertisement
Guest User

Untitled

a guest
May 22nd, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.83 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3. #include <fstream>
  4. #include <iso646.h>
  5. using namespace std;
  6. int main()
  7. {
  8.     setlocale(0, "");
  9.     int n = 0;
  10.     float a, b, c, d;
  11.     int sum = 0;
  12.     fstream F;
  13.     fstream G;
  14.     fstream H;
  15.     fstream J;
  16.     F.open("E:\\Diplom\\SIG1\\A.txt");
  17.     G.open("E:\\Diplom\\SIG1\\B.txt");
  18.     H.open("E:\\Diplom\\SIG1\\C.txt");
  19.     J.open("E:\\Diplom\\SIG1\\D.txt");
  20.     if (F, G, H, J)
  21.     {
  22.         while (!F.eof(), !G.eof(), !H.eof(), !J.eof())
  23.         {
  24.             F >> a;
  25.             G >> b;
  26.             H >> c;
  27.             J >> d;
  28.             n++;
  29.             if (a > b & a > c & a > d)
  30.             {
  31.            
  32.             }
  33.             else
  34.             {
  35.                 sum++;
  36.             }
  37.         }
  38.         F.close();
  39.         G.close();
  40.         H.close();
  41.         J.close();
  42.         cout << " Число сигналов " << n - 1 << " Количество ошибок: " << sum - 1 << endl;
  43.     }
  44.     else cout << "Error" << endl;
  45.     system("pause");
  46.     return 0;
  47.  
  48.  
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement