#include<iostream>
using namespace std;
int main()
{
int i,j,k;
for(i=1;i<=6;i++)
{
k=10;
for(j=1;j<=11;j++)
{
cout<<" ";
if(j>=i && j<=12-i)
{
cout<<k;
k--;
}
else
cout<<" ";
}
cout<<"\n";
}
return 0;
}
Image:
I wrote this code but it is not working as expected as my logic is not completely correct.
Aucun commentaire:
Enregistrer un commentaire