anyone has an idea ?

i need to invert this using for loop

*****
****
***
**
*
to
*****
..****
....***
......**
........*
Last edited on
closed account (Dy7SLyTq)
well, just have it as a vector of a size that once set doesnt change and then at each iteration replace the * with a " "
im beginner ...so i cant use vector because i dont know it... i need a simple idea using for loop
i try it like this
for(i=1;i<=N;i++)
{ for(j=0;j<=N-i;j++)
cout<<"*";
for(k=1;k<=i;k++)
cout<<" ";
cour<<endl;
}

.
.
.
so i what o have to change ? any idea ?
closed account (Dy7SLyTq)
is N an int input by the user?
yes sure
Topic archived. No new replies allowed.