Add .clang-format and apply it
This commit is contained in:
@@ -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 < 41; ++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";
|
||||
}
|
||||
|
Reference in New Issue
Block a user