Skip to content

Instantly share code, notes, and snippets.

@HappyCerberus
Last active December 1, 2021 12:38
Show Gist options
  • Save HappyCerberus/a7af4df435c26368f689f7a342f9e2c7 to your computer and use it in GitHub Desktop.
Save HappyCerberus/a7af4df435c26368f689f7a342f9e2c7 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 averaged over a sliding window of 3 elements increased in "
<< count_increasing_windows(input) << " cases.\n";
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment