5. В текстовом файле хранится текст. Вывести на экран только строчные английские буквы, входящий в этот текст. помогите пожалуйста
Папонт, #include <iostream> #include <fstream> #include <cctype> using namespace std; int main() { ifstream inputFile("file.txt"); if (!inputFile) { cerr << "Failed to open file" << endl; return 1; } char ch; while (inputFile.get(ch)) { if (islower(ch) && isalpha(ch)) { cout << ch; } } inputFile.close(); return 0; } C #include <iostream> #include <fstream> #include <cctype> using namespace std; int main() { ifstream inputFile("file.txt"); if (!inputFile) { cerr << "Failed to open file" << endl; return 1; } char ch; while (inputFile.get(ch)) { if (islower(ch) && isalpha(ch)) { cout << ch; } } inputFile.close(); return 0; } СГЕНЕРИРОВАНО ЧЕРЕЗ CHATGPT
#include <iostream> #include <fstream> #include <cctype> int main(){ std::ifstream in("file.txt"); char s; while(in.get(s)){ if (islower(s)) std::cout << s; } std::cin.get(); } C #include <iostream> #include <fstream> #include <cctype> int main(){ std::ifstream in("file.txt"); char s; while(in.get(s)){ if (islower(s)) std::cout << s; } std::cin.get(); }