Help explain the program a few things you don t understand. Very simple procedure

Updated on technology 2024-02-09
4 answers
  1. Anonymous users2024-02-05

    I think questions 1 and 2 should be looked at together, bool assigns a value to inword is false, if(!isspace(c)&&inword), since &&& requires that the expressions on both its left and right sides be true, because the initial assignment to inword is false, then! inword is true (inword is false, false is false, then the relationship inword==false is true,!

    inword is also true, so they are equivalent), so that the first non-whitespace letter entered qualifies as if. When the first non-blank letter enters the if statement, and then assign the value of ture to inword, then inword is true, and then add 1 to n-words, and assign this letter to prev.

    The second non-blank letter of the first word enters the while loop, in if(!isspace(c)&&inword) condition, because inword is true, then now! inword is false, because && needs the formula to be true in two paragraphs, then the second letter does not meet the if condition, it will enter the next if(isspace(c)&&inword), because it is a non-blank letter, it does not meet the conditions, assign this letter to prev, then the third character of this word enters the while loop.

    Assuming the third character is a whitespace character, then it does not conform to if(!).isspace(c)&&inword), then it goes to the next if, if(isspace(c)&&&inword), because the current isspace(c) and inword are true, then it satisfies the condition, enters the if statement, and then assigns false false to inword, and inword becomes false again. Then assign this whitespace character to prev.

    At this point, the next word loops on.

    Now to the third question, based on the above analysis, we know that every input character will be assigned a value to prev. in the input'|'The preceding character is the last character to enter the while loop. As is customary, if the last line is complete, we type in a line break, then due to the first if statement in the while loop (c==''), then this line will be counted to the number of lines, but if the last sentence entered is not a complete line, we will generally enter a full stop ending (or other non-line breaks), then the last line will not enter a line break, and the last line will not be counted to the number of lines, at this time, because the last character is assigned to prev, after jumping out of the while loop, it satisfies if(prev!).

    '), p-line=1, the record is incomplete.

  2. Anonymous users2024-02-04

    The variable prev is useless and can be removed.

    A word is composed of multiple characters, inword is used to determine whether the obtained characters are in the same word, if in the same word, its value is true, if not, it is false.

  3. Anonymous users2024-02-03

    He's saying there's a string s

    Then let you count how many numbers are in the string, i.e. 0 9for loop through the string, from s[0] until the end of the string if s[i] is one of the characters of 0 9, n++, count +1 because you have one in the string'\0'character, so as of there, the s string is over, followed by 8s34. are no longer traversed.

    So the s string is actually traversed as 012xy

    So there are 3 numbers in total, choose B

  4. Anonymous users2024-02-02

    It's very logical, and you should be able to get a result by doing the math with a pen on paper.

Related questions
14 answers2024-02-09

At present, there are more and more recharge software, and the new software is also full of advertisements that say very well, I have used several kinds, with personal experience, I feel that after choosing a good software, the most important thing is to choose a professional and responsible home, choosing a good home is equal to half the success, how good software do you want, if you meet an irresponsible home, whether you don't teach you, then isn't it equal to zero, fortunately I chose the store 520 Doudou Sugar is a responsible person, or they are more confused, She didn't answer any questions I asked, but also patiently gave me guidance, and taught me some skills and experience, so you can ask her if you need to.

7 answers2024-02-09

fuction should be functional

wub should be sub >>>More

16 answers2024-02-09

In fact, the easiest way to do this kind of problem is to set up unknowns and list systems of equations. >>>More

8 answers2024-02-09

The C language program written according to the requirements of the topic is as follows. >>>More

5 answers2024-02-09

Program debugging is the process of testing the compiled program by manual or compiling the program to correct syntax errors and logical errors before putting it into actual operation. This is an indispensable step to ensure the correctness of computer information systems. After the computer program is written, it must be sent to the computer for testing. >>>More