Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <string>
- #include <vector>
- using namespace std;
- string encrypt(const std::string &word) {
- string res;
- res.reserve(word.size());
- for (int i = 0; i < word.size(); i++) {
- res.push_back(~word[i]);
- }
- return res;
- }
- void put(const char *name, const std::vector<const char *> &vec) {
- std::ofstream file{name, std::ios::out | std::ios::binary};
- if (!file.is_open()) {
- std::cerr << "File is not open! " << std::endl;
- } else {
- for (auto &i: vec) {
- file << encrypt(i) << std::endl;
- }
- }
- }
- int main() {
- string path = "Word";
- put("Word",
- {"Tron", "Shusha", "Zamanov", "Moquda", "boss", "main", "Scooby", "void", "Shamakhi", "Kiev", "Baku", "Leon",
- "step", "root", "Suleyman", "Baku", "Maide"});
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement