From 1fb56f5e0fa0672a479219a9ba1f2e5d834ad1fb Mon Sep 17 00:00:00 2001 From: Aditya Date: Wed, 4 May 2022 15:24:12 +0530 Subject: [PATCH] add files and update README --- README.md | 12 +++++++++++- shout.cpp | 23 +++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 shout.cpp diff --git a/README.md b/README.md index b17a9f5..fecf5ea 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,13 @@ # shout -shout in two dimensions \ No newline at end of file +shout in two dimensions + +``` +./shout aaaaaa +a a a a a a +a a +a a +a a +a a +a a +``` diff --git a/shout.cpp b/shout.cpp new file mode 100644 index 0000000..d3e266d --- /dev/null +++ b/shout.cpp @@ -0,0 +1,23 @@ +#include + +int main(int argc, char** argv) +{ + for (int a {1}; a < argc; ++a) + { + for (int i {}; argv[a][i] != '\0'; ++i) + { + std::cout << argv[a][i] << " "; + } + std::cout << std::endl; + for (int i {1}; argv[1][i] != '\0'; ++i) + { + std::cout << argv[1][i] << " "; + for (int j {1}; j < i; ++j) + { + std::cout << " "; + } + std::cout << argv[a][i] << std::endl; + + } + } +}