Advertisement
YT_o4ka

Untitled

Mar 16th, 2022
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. #define _CRT_SECURE_NO_WARNINGS
  2. #include <iostream>
  3. #include <windows.h>
  4.  
  5. using namespace std;
  6.  
  7. int main() {
  8.  
  9.  
  10. FILE* in;
  11. FILE* out;
  12. in = fopen("f1.txt", "r");
  13. out = fopen("f2.txt", "w+");
  14. char c;
  15. while (!feof(in)) {
  16. fread(&c, 1, 1, in);
  17. if (c >= 48 && c <= 57) {
  18. fwrite(&c, 1, 1, out);
  19. }
  20. }
  21. fclose(in);
  22. in = fopen("f1.txt", "r");
  23. fread(&c, 1, 1, in);
  24. while (!feof(in)) {
  25. if ((c >= 65 && c <= 90) || (c >= 97 && c <= 122)) {
  26. fwrite(&c, 1, 1, out);
  27. }
  28. fread(&c, 1, 1, in);
  29. }
  30. fclose(in);
  31. fclose(out);
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement