Pattern problem

#include
using namespace std;
int main()
{ int i,j,n;
//cout<<“enter number of rows.”<<endl;
cin>>n;
for(i=1;i<=n;i++)
{
for(j=1;j<=i;j++)
{
if(j==1||j==i)
{
cout<<i;
}
else {
cout<<“0”;
}
} cout<<endl;
}

return 0;

}
the code shows wrong test cases although the ans is correct