Skip to content

Instantly share code, notes, and snippets.

@gtaing1
Last active January 3, 2016 06:53
Show Gist options
  • Save gtaing1/61bd92f12f94ebdf5871 to your computer and use it in GitHub Desktop.
Save gtaing1/61bd92f12f94ebdf5871 to your computer and use it in GitHub Desktop.
// Example program
#include <iostream>
#include <string>
int main()
{
std::string name;
for (int row=1; row<=6;row++) {
for (int hash=1; hash<=6-row;hash++) {
std::cout<< "#";
}
std::cout<< "\n";
}
}
// Example program
#include <iostream>
#include <string>
int main()
{
std::string name;
for (int row=1; row<=6;row++) {
for (int hash=1; hash<=6-row;hash++) {
std::cout<< "#";
}
std::cout << 6-row<< "\n";
}
}
#include <iostream>
#include <string>
int main()
{
std::string name;
for (int row=1; row<=6;row++) {
for (int hash=1; hash<=4-abs(4-row);hash++) { //
std::cout<< "#";
}
std::cout << 4-abs(4-row)<< "\n";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment