agrawal-d/cph

CPH VScode extension removing space from Input and Output

MrBns opened this issue · 0 comments

I was printing a pattern in c. but it doesnt print space before any character.
my code is

int main()
{

    int n;
    scanf("%d", &n);

    int sym = 1;
    int space = n - 1;

    for (int i = 0; i < (n * 2); i++)
    {

        for (int j = 0; j < space; j++)
        {
            printf(" ");
        }
        for (int j = 0; j < sym; j++)
        {
            printf("#");
        }
        printf("\n");

        if (i < n - 1)
        {
            sym += 2;
            space--;
        }
        else
        {
            sym -= 2;
            space++;
        }
    }
}

expected output is:

    #
  ---
 #####
-------
 #####
  ---
   #

but the result I got is

#
  ---
 #####
-------
 #####
  ---
   #

but unfortunately CPH remove all spaced before # of first line. rest of the lines are okay. it happened with first line. I think CPH should trim the output. also I noticed that it also removed space from input also.. I tihnk in both it is triming the input and output.

Extension Version: 4.5

VS Code Version: 1.85

Browser Version:

Operating System: Ubuntu 23.10 x86_64