Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * ДЗ 3 Задача "Фильтр"
- */
- void fileFilter() {
- string line;
- cout << endl;
- ifstream in("D:\\visualstudio-workspace/Test/input.txt"); // окрываем файл для чтения
- if (in.is_open())
- {
- while (getline(in, line))
- {
- for (int i = 0; i < line.length(); i++) {
- switch (line[i]) {
- case '0':
- cout << line[i];
- break;
- case '1':
- cout << line[i];
- break;
- case '2':
- cout << line[i];
- break;
- case '3':
- cout << line[i];
- break;
- case '4':
- cout << line[i];
- break;
- case '5':
- cout << line[i];
- break;
- case '6':
- cout << line[i];
- break;
- case '7':
- cout << line[i];
- break;
- case '8':
- cout << line[i];
- break;
- case '9':
- cout << line[i];
- break;
- default:
- break;
- }
- }
- cout << endl;
- }
- }
- in.close(); // закрываем файл
- }
Advertisement
Add Comment
Please, Sign In to add comment