i am getting right sample output but it is showing wrong in some test cases .i dont understand what is wrong in my code .how can i verify this?
#include
using namespace std;
int main()
{
int N, j, k;
cin>>N;
for (N = 1; N <= 4; N++)
{
k = N;
for (j = 1; j <= 7; j++)
{
if (j>=5-N && j<=3+N)
{
cout<<k;
j<4?k++:k–;
}
else
{
cout << " “;
}
cout<<”\t";
}
cout << endl;
}
return 0;
}