/******************************************************************************
Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
C#, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
Code, Compile, Run and Debug online from anywhere in world.
*******************************************************************************/
#include <iostream>
#include <string>
//#include <array>
constexpr int offset=20;
template <char c='*',int N=5>
struct print{
constexpr print (){
//std::cout<<count<<std::endl;
for(int i=offset;i>N;--i) std::cout<<' ';
for(int i=0;i<N;++i) std::cout<<c<<c;
std::cout<<std::endl;
}
~print(){
for(int i=offset;i>N;--i) std::cout<<' ';
for(int i=0;i<N;++i) std::cout<<c<<c;
std::cout<<std::endl;
}
};
//Check if for loop can eliminated using TempMetaProg
/*template <>
struct print<0>
{
static constexpr int s = 1;
};*/
int main()
{
print<'*',1> p1;
print<'*',3> p2;
print<'*',5> p;
print<'*',7> q;
//std::cout <<p.a<<std::endl;
//std::cout <<q.a<<std::endl;
return 0;
}
/*
**
******
**********
**************
**************
**********
******
**
...Program finished with exit code 0
Press ENTER to exit console.
*/