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

@@ -7,7 +7,8 @@
#include <string>
#include <variant>
std::string look_and_say(std::string const &s) {
std::string look_and_say(std::string const& s)
{
std::string result;
for (std::string::size_type i = 0; i < s.length();) {
unsigned num = 0;
@@ -22,14 +23,13 @@ std::string look_and_say(std::string const &s) {
return result;
}
int main(int argc, char **argv) {
int main(int argc, char** argv)
{
for (std::string line; std::getline(std::cin, line);) {
std::cout << "Application 0, length = " << line.length() << ": " << line
<< "\n";
std::cout << "Application 0, length = " << line.length() << ": " << line << "\n";
for (int i = 1; i < 51; ++i) {
line = look_and_say(line);
std::cout << "Application " << i << ", length = " << line.length()
<< "\n";
std::cout << "Application " << i << ", length = " << line.length() << "\n";
}
std::cout << "Length: " << line.length() << "\n";
}