online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#include <iostream> #include <fstream> #include <map> #include <vector> #include <utility> #include <algorithm> int main() { std::map<char, int> m; std::string s, text; std::ifstream in("1.txt"); std::vector<std::pair<char, int>> v; if (!in) { std::cout << "failed to open file."; return 1; } while(getline(in,s)) text += s; for (auto &symb : text) { if(isalpha(symb)) m[symb]++; } for (auto &e : m) { v.push_back(e); } std::sort(v.begin(), v.end(), [](std::pair<char, int> &p1, std::pair<char, int> &p2){return p1.second > p2.second;} ); for (auto &e : v) { std::cout << e.first << ": " << e.second << "\n"; } return 0; }
lorem ipsum dolor sit amet.

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue