December 13, 2018
Draw triangles
Threads: Enter an integer x. Draw a triangle mark * looks like the example below.
Input: An integer
Output: Triangular
For example:
input: 3 output: *** ** *
You are not logged in? Log in to Submit Now!
12 Comments
Add a Comment
You must be logged in to post a comment.
Can someone help me solve this problem, Couldn't find a solution
Use that loop, a loop to print the signs * create 1 rows and one more loop to iterate over those rows.
You use 2 nested loop.
Loop 1 repeat from n to 1 to form rows.
Loop 2 repeat word 1 to n to form the signs *
for (i = n; i > 0; i–)
{
for (j=1; j<n; j++)
}
Can you give me more specific instructions?
For (j=1;j<i;j++)
Can you tell me if the software is faulty?, it says ERROR CONNECT
Sorry, The system is working normally now.
There is a problem with this post and the rectangular post right now,
The system could not output its output, so it was marked incorrectly.
This is the wrong case when, at the wrong time another case. But the common point is that my output is empty.
Tested on online and local IDEs, the results are normal.
Please help admin see.
Please watch it again, I use your code and it works fine.
OK, thank admin nhé 😀
I'm wrong
API is under maintenance, please come back later
Error connect
What does that mean
The system is working again.