Presentation Error,真的没有找出来,求指点。

Presentation Error,真的没找出来,求指点。。。
下面是题和我的源代码,真的没找出来Presentation Error


Draw triangle, parallelogram and rectangle.

    *                      ****               ****
   ***                    ****                ****
  *****                  ****                 ****
 *******                ****                  ****
*********              ****                   ****

Triangle (5)         Parallelogram (4x5)      Rectangle (4x5)

In the above figure between first brackets the dimension is given. For triangle the height will be given, for parallelogram and rectangle the width and height will be given. The character dot ('.') in the above figure will be represented by ASCII character space in the output.
Input
First line of each input set indicates category C.
If C=1 it is a triangle. Then following line of input indicates the height H ranging 1≤H≤10.
If C=2 it is a parallelogram. Then following line of input have two integers width W and height H ranging 1≤W≤10 and 1≤H≤10.
If C=3 it is a rectangle. Then following line of input have two integers width W and height H ranging 1≤W≤10 and 1≤H≤10.
C= -1 indicates the end of input set. This will not be considered as input.
Output
Output will be drawn by character '*' as following. Print a blank line after each output.

Sample input

1
5
2
5 3
3
4 6
-1

Sample output:

    *
   ***
  *****
 *******
*********

  *****
 *****
*****

****
****
****
****
****
****



下面是代码

#include <iostream>
using namespace std;
int main() {
int c = 0;
while(c != -1) {
cin >> c;
if (c == 1) {
int H1;
cin >> H1;
if (1 <= H1 && H1 <= 10) {
char line1[2*H1 - 1];
for (int i1 = 0; i1 < 2*H1 - 1; i1++) {
line1[i1] = ' ';
}
for (int j1 = 0; j1 < H1; j1++) {
for (int k1 = H1 - j1 - 1; k1 <= H1 + j1 - 1; k1++) {
line1[k1] = '*';
}
for (int p1 = 0; p1 < 2*H1 - 1; p1++) {
cout << line1[p1];
}
cout << endl;
}
cout << endl;
}
}
if (c == 2) {
int W2, H2;
cin >> W2 >> H2;
if (1 <= W2 && W2 <= 10 && 1 <= H2 && H2 <= 10) {
for (int j2 = 1; j2 <= H2; j2++) {
for (int i2 = 0; i2 < H2 - j2; i2++) {
cout << " ";
}
for (int k = 1; k <= W2; k++) {
cout << "*";
}
cout << endl;
}
cout << endl;
}
}
if (c == 3) {
int W3,H3;
cin >> W3 >> H3;
if (1 <= W3 && W3 <= 10 && 1 <= H3 && H3 <= 10) {
char line3[W3];
for (int i3 = 0; i3 < W3; i3++) {
line3[i3] = '*';
}
for (int j3 = 0; j3 < H3; j3++) {
for (int u3 = 0; u3 < W3; u3++) {
cout << line3[u3];
}
cout << endl;
}
cout << endl;
}
}
}
return 0;
}
------解决思路----------------------
C=1你行末有多余空格