Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <fstream>
- #include <iostream>
- #define vowelsCount 5
- std::ifstream input("./input.txt");
- std::ofstream output1("./output1.txt");
- std::ofstream output2("./output2.txt");
- char vowels[vowelsCount] = {'A', 'E', 'I', 'O', 'U'};
- bool isVowel(char c) {
- for (int i = 0; i < vowelsCount; i++) {
- if (vowels[i] == c || vowels[i] == c + 'A' - 'a')
- return true;
- }
- return false;
- }
- int main (void) {
- char* s;
- while (input) {
- input>>s;
- if (isVowel(s[0])) {
- output1<<s<<"\n";
- // output1<<"\n";
- } else {
- output2<<s<<"\n";
- // output2<<"\n";
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement