mirror of
https://git.adityakumar.xyz/shout.git
synced 2024-11-09 08:19:44 +00:00
add files and update README
This commit is contained in:
parent
a4bc1d2f37
commit
1fb56f5e0f
2 changed files with 34 additions and 1 deletions
10
README.md
10
README.md
|
@ -1,3 +1,13 @@
|
||||||
# shout
|
# shout
|
||||||
|
|
||||||
shout in two dimensions
|
shout in two dimensions
|
||||||
|
|
||||||
|
```
|
||||||
|
./shout aaaaaa
|
||||||
|
a a a a a a
|
||||||
|
a a
|
||||||
|
a a
|
||||||
|
a a
|
||||||
|
a a
|
||||||
|
a a
|
||||||
|
```
|
||||||
|
|
23
shout.cpp
Normal file
23
shout.cpp
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue