tipplektionen/main.cpp

36 lines
847 B
C++
Raw Normal View History

2023-03-08 21:01:11 +01:00
#include <fstream>
#include <iostream>
#include <string>
#include <boost/program_options.hpp>
namespace po = boost::program_options;
int main(int argc, char *argv[])
{
2023-03-08 21:16:15 +01:00
std::string letters;
2023-03-08 21:01:11 +01:00
po::options_description desc("Erlaubte Optionen");
2023-03-08 21:16:15 +01:00
desc.add_options()("help,h", "Ausgabe der Hilfe")("letters,l", po::value<std::string>(&letters),
"Enthaltene Buchstaben");
2023-03-08 21:01:11 +01:00
po::variables_map vm;
po::store(po::parse_command_line(argc, argv, desc), vm);
po::notify(vm);
if (vm.count("help")) {
std::cout << desc << std::endl;
return 1;
}
std::ifstream infile("../wortliste.txt");
std::string line;
long counter{0};
while (std::getline(infile, line)) {
counter++;
}
std::cout << "Anzahl: " << counter << std::endl;
}