Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<fstream>
- #include<string>
- #include<vector>
- using namespace std;
- ifstream cin("input.txt");
- ofstream cout("output.txt");
- int i, cnt, t;
- string s;
- bool fan1, fan2;
- vector <string> v;
- int main()
- {
- while (!cin.eof())
- {
- getline(cin, s);
- v[i] = s.substr(2, s.size() - 1);
- i++;
- }
- for (int j = 0; j < i; j++)
- for (int z = 0; z < i; z++)
- {
- if (v[j].size() <= v[z].size() && j != i)
- {
- for (int q = 0; q < v[j].size(); q++)
- if (v[j][q] == v[i][q]) cnt++;
- if (cnt == v[j].size()) fan1 = 1;
- cnt = 0;
- ////
- for (int w = v[z].size() - v[j].size(); w < v[z].size(); w++)
- {
- if (v[j][t] == v[z][i]) cnt++;
- t++;
- }
- if (cnt == v[j].size()) fan2 = 1;
- cnt = 0;
- t = 0;
- }
- }
- cout << "Прямое условие Фано ";
- if (fan1 == 1) cout << "не выполняется" << endl;
- else cout << "выполняется" << endl;
- //
- cout << "Обратоное условие Фано ";
- if (fan2 == 1) cout << "не выполняется" << endl;
- else cout << "выполняется" << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement