Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <fstream>
- #include <string>
- using namespace std;
- int main()
- {
- string str;
- ifstream ifs("english.in");
- getline(ifs, str);
- ifs.close();
- int T = 0, X = 0;
- for (int i = 0; i < str.length(); i++)
- {
- if (str[i] != 'y')
- {
- if (str[i] == 'a' || str[i] == 'e' || str[i] == 'i' || str[i] == 'o' || str[i] == 'u')
- X++;
- else
- T++;
- }
- }
- ofstream ofs("english.out");
- if (X > T)
- ofs << "vowels" << endl;
- else if (X < T)
- ofs << "consonants" << endl;
- else
- ofs << "equal" << endl;
- ofs.close();
- }
Advertisement
Add Comment
Please, Sign In to add comment