Advertisement
SteelK

Untitled

Jun 18th, 2016
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.48 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include <iostream>
  3. #include <string>
  4. #include <fstream>
  5.  
  6. int main()
  7. {
  8.     std::ofstream FILE1("FILE1.txt");
  9.     std::string TEXT;
  10.     std::cout << "Insert text with nubmers in it:" << std::endl;
  11.     std::getline(std::cin, TEXT);
  12.     FILE1 << TEXT;
  13.     FILE1.close();
  14.     size_t size = TEXT.size();
  15.  
  16.     for (size_t i = 0; i < size; i++)
  17.         if (TEXT[i] > 47 && TEXT[i] < 58)
  18.             TEXT[i] = 33;
  19.  
  20.     std::ofstream FILE2("FILE2.txt");
  21.     FILE2 << TEXT;
  22.     FILE2.close();
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement