Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define _CRT_SECURE_NO_WARNINGS
- #include <iostream>
- #include <string>
- #include <fstream>
- #include <Windows.h>
- using namespace std;
- int main() {
- SetConsoleCP(1251);
- SetConsoleOutputCP(1251);
- ifstream fin;
- ofstream fout;
- fin.open("file.txt");
- fout.open("file2.txt");
- if (!fin.is_open() || !fout.is_open()) {
- cout << "Ошибка открытия файла" << endl;
- }
- else {
- char ch;
- while (fin.get(ch)) {
- if (ch >= 'А' && ch <= 'Я') {
- ch += 32;
- }
- fout << ch;
- }
- fin.close();
- fout.close();
- remove("file.txt");
- rename("file2.txt", "file.txt");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement