cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
anyone has an idea ?
anyone has an idea ?
Mar 14, 2013 at 8:19pm UTC
abzksm
(21)
i need to invert this using for loop
*****
****
***
**
*
to
*****
..****
....***
......**
........*
Last edited on
Mar 14, 2013 at 8:21pm UTC
Mar 14, 2013 at 8:25pm UTC
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 " "
Mar 14, 2013 at 8:34pm UTC
abzksm
(21)
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 ?
Mar 14, 2013 at 8:36pm UTC
closed account (
Dy7SLyTq
)
is N an int input by the user?
Mar 14, 2013 at 8:39pm UTC
abzksm
(21)
yes sure
Topic archived. No new replies allowed.