How to wrap line input in C language, and how to wrap line if you can t write a line in C language?

Updated on technology 2024-03-01
10 answers
  1. Anonymous users2024-02-06

    In C, you can't actually get carriage returns with any method (regular library functions). Because the console is after you enter a line and click enter, send the characters other than the enter to the program input cache together, you can only use workarounds, such as getting a line, a character or a number at a time, and setting multiple inputs, then after entering, it will inevitably go into the next input or ** block.

    For example: with two scanf commands.

    scanf("%d",&a);

    scanf("%d",&b);

    In this way, you can enter the next input or block.

  2. Anonymous users2024-02-05

    Then the input program is:

    scanf("%d%d%d",&a,&b,&c);

    In this case, the value of the first row is assigned to a, the value of the second row is assigned to b, and the value of the third row is assigned to c

    If you want to enter a single character or a string.

    It's the same thing. with""to wrap lines. But the last one is the input data.

    It cannot be added later.

  3. Anonymous users2024-02-04

    printf("");

    n This thing is line break.

    For example, outputting a number would look like this.

    int a;

    printf("%d",a);

  4. Anonymous users2024-02-03

    First of all, you need to solve the problem of entering n lines to stop, which can generally end with a character of your choice such as " ";

    Of course, there is space for and new here;

    Second, the input for each row is available;

    Then there is the output;

    Finally use for and new to remove!

  5. Anonymous users2024-02-02

    In C++ you can use string and vector:

    #include

    #include

    vectorstrvct(100);

    Swap it out for your own judgment to enter the end condition.

    while(getline(cin, s, ''));

  6. Anonymous users2024-02-01

    The second loop reads like this:

    for(i = 99;; i >= 0; i--)if(i % 20 == 0)

    printf("%d", a[i]);

    elseprintf("%d", a[i]);

  7. Anonymous users2024-01-31

    Define an array of strings.

    int i;

    char ss[10][100];

    for(i=0;i<10;i++)

    gets(ss[i]);

  8. Anonymous users2024-01-30

    If you can't write a line in the C language, you can write it across lines. But there are two cases:

    1.Preprocessing a single line cannot be written: Write a preprocessing instruction as multiple lines with a " " continuation line, because by definition, a preprocessing instruction can only consist of one logical ** line.

    2.The normal program can't write a single line: you don't need to use a line continuation when writing c** as multiple lines, because a line break is just a whitespace character in c**, and all whitespace characters are discarded when doing syntax parsing.

  9. Anonymous users2024-01-29

    Brand model: Redmibook Pro 15 System: Windows 10

    The line break is used in the C language, which is an escape character, because the line break is not a printable character, so it is represented by the escape character Qinghengji. Chain Block.

    C language is a process-oriented, abstract general programming language, widely used in the underlying development, C language can compile and process low-level memory in a simple way, C language is a high-efficiency programming language that only produces a small number of machine languages and can run without any runtime environment support.

  10. Anonymous users2024-01-28

    1. n--, first take the value of n for operation, and then n self-subtract after the operation;

    For example: n=10;

    k=10*n--+3;

    then k=103, n=9

    2、--n: first n self-subtract from n, and then take the value of n for calculation;

    For example: n=10;

    k=--n*10+3;

    then k=93, n=9

Related questions
7 answers2024-03-01

It's called the [batch] program, in fact, don't think that the program you mentioned above to deal with garbage is really powerful, it's amazing, when you have learned DOS, that program can be said to be a very simple thing; >>>More

5 answers2024-03-01

int main()

int i,j,k; >>>More

4 answers2024-03-01

It's not very hard that the tail node next points to null. >>>More

8 answers2024-03-01

I want to ask, have you written it now?

8 answers2024-03-01

It's nonsense to say so much above. Landlord please see: pay attention to your program: printf("%d,%d",(a,b),(b,a); >>>More