This repository has been archived on 2022-06-05. You can view files and clone it, but cannot push or open issues or pull requests.
Files
AiSD/Part1/Lab2/Lab2.cpp
2022-05-14 15:22:55 +03:00

26 lines
709 B
C++

#include <string.h>
#include <stdlib.h>
#include <time.h>
#include <iostream>
using namespace std;
#include "Set4.h"
int Set::N = 26, Set::cnt = 0; // Îïðåäåëåíèå ñòàòè÷åñêèõ ÷ëåíîâ êëàññà
const long q0 = 100000; // Êîëè÷åñòâî ïîâòîðåíèé öèêëà âðåìåíè
int main()
{
srand(time(nullptr));
Set A('A'), B('B'), C('C'), D('D'), E; //A, B, C, D ãåíåðèðóþòñÿ. E — ïóñòîå ìí-âî
clock_t begin = clock();
for (long q = 0; q < q0; ++q)
{
E = D & (A | B) & ~C;
//E = ~A;
}
clock_t end = clock();
E.Show();
cout << " Middle power =" <<
(A.power() + B.power() + C.power() + D.power() + E.power()) / 5 <<
" Time=" << end - begin << " / " << q0 << endl;
cin.get();
return 0;
}