Add .clang-format and apply it

This commit is contained in:
2021-12-02 07:18:16 +00:00
parent e58dede1b6
commit cd5e2538df
103 changed files with 2714 additions and 2132 deletions

View File

@@ -14,9 +14,9 @@ constexpr Quantity total = 150;
using Quantities = std::vector<Quantity>;
unsigned count_combinations(Quantities::const_iterator it,
Quantities::const_iterator end, Quantity amount,
unsigned depth = 0) {
unsigned count_combinations(Quantities::const_iterator it, Quantities::const_iterator end,
Quantity amount, unsigned depth = 0)
{
// We have no room for this container
std::cout << std::string(depth, ' ') << *it << ": " << amount << "\n";
if (amount < *it) {
@@ -36,7 +36,8 @@ unsigned count_combinations(Quantities::const_iterator it,
return result;
}
unsigned count_combinations(Quantities const &containers) {
unsigned count_combinations(Quantities const& containers)
{
unsigned result = 0;
for (auto it = containers.begin(); it != containers.end(); ++it) {
result += count_combinations(it, containers.end(), total);
@@ -44,7 +45,8 @@ unsigned count_combinations(Quantities const &containers) {
return result;
}
int main(int argc, char **argv) {
int main(int argc, char** argv)
{
std::string line;
Quantities containers;
while (std::getline(std::cin, line)) {