Skip to content

Instantly share code, notes, and snippets.

@HappyCerberus
Created December 1, 2021 12:18
Show Gist options
  • Save HappyCerberus/ae736b03b45447eef81c19097139a315 to your computer and use it in GitHub Desktop.
Save HappyCerberus/ae736b03b45447eef81c19097139a315 to your computer and use it in GitHub Desktop.
int main(int argc, char *argv[]) {
if (argc != 2) {
std::cerr << "This program expects one parameter that is the input file to read.\n";
return 1;
}
std::ifstream input(argv[1]);
if (!input.is_open()) {
std::cerr << "Failed to open file.\n";
return 1;
}
std::cout << "The measured depth increased in " << count_increasing(input) << " cases.\n";
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment