feat: add quiz 2 counter.
This commit is contained in:
21
counter/main.cpp
Normal file
21
counter/main.cpp
Normal file
@@ -0,0 +1,21 @@
|
||||
#include <counter.h>
|
||||
#include <iostream>
|
||||
|
||||
int main(const int argc, char** argv)
|
||||
{
|
||||
if (argc != 2)
|
||||
{
|
||||
std::cout << "ERROR: Need a string." << std::endl;
|
||||
}
|
||||
|
||||
const std::string input(argv[1]);
|
||||
|
||||
const auto map = counter::Counter::count(input);
|
||||
|
||||
for (const auto& pair : map)
|
||||
{
|
||||
std::cout << pair.first << ' ' << pair.second << std::endl;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user