Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- #include <string>
- #include <vector>
- #include <algorithm>
- #include <fstream>
- using std::string;
- int main()
- {
- std::ifstream inFile ("C:\\reddit\\infl.txt");
- string input;
- std::cin >> input;
- std::transform(input.begin(), input.end(), input.begin(), ::tolower);
- sort(input.begin(), input.end());
- string word;
- if (inFile.is_open()){
- while (!inFile.eof()){
- string temp;
- inFile >> word;
- std::transform(word.begin(), word.end(), word.begin(), ::tolower);
- sort(word.begin(), word.end());
- if (word == input){
- std::cout << "Decoded word: " <<temp << std::endl;
- break;
- }
- }
- }
- std::system("PAUSE");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement