Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CPH VScode extension removing space from Input and Output #404

Open
MrBns opened this issue Dec 26, 2023 · 0 comments
Open

CPH VScode extension removing space from Input and Output #404

MrBns opened this issue Dec 26, 2023 · 0 comments
Labels
good first issue Good for newcomers

Comments

@MrBns
Copy link

MrBns commented Dec 26, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants