Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include<iostream>
- #include<string>
- #include<fstream>
- using namespace std;
- ifstream ohno("enable1.txt");
- bool checkIb4ExC(string test) {
- for (int a = 0; a < test.length(); a++)
- {
- if (a > 0) {
- if (test[a] == 'e' && test[a + 1] == 'i' && test[a - 1] != 'c') {
- return false;
- }
- if (test[a] == 'i' && test[a + 1] == 'e' && test[a - 1] == 'c') {
- return false;
- }
- }
- }
- if (test[0] == 'e' && test[1] == 'i') {
- return false;
- }
- return true;
- }
- int main() {
- string cancer, happystring;
- int counter = 0;
- cout << boolalpha << ohno.is_open() << endl;
- while (ohno >> cancer)
- {
- //happystring += cancer + "\n";
- if (checkIb4ExC(cancer) == false) {
- counter++;
- }
- }
- cout << counter;
- cout << checkIb4ExC("a") << endl;
- cout << checkIb4ExC("zombie") << endl;
- cout << checkIb4ExC("tranceiver") << endl;
- cout << checkIb4ExC("veil") << endl;
- cout << checkIb4ExC("icier") << endl;
- cout << checkIb4ExC("ei") << endl;
- cout << checkIb4ExC("ie") << endl;
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement