int main()
{
int i,j,k,n;
scanf("%d",&n);
for(i=1;i<=n;i++)
{
if(i%2==0)
{
k=2;
}
else
{
k=1;
}
for(j=1;j<=i;j++,k+=2)
{
printf("%d ", k);
}
printf("\n");
}
return 0;
}
No comments:
Post a Comment