(Topic III) 02-1 and program design process - selection structure

 

Select the structure to achieve with an if statement

Two-branch if statement

First determine whether x is an odd function called rem,

If the remainder is on a odd, y will be assigned to the square root of x

Otherwise, the cube root of x will be assigned to y

Multi-branch if statement

No matter how many branches after if, after the completion of the implementation of a program branch, the remaining branches will not be executed

To enter a character c

Then multi-branch, it is judged whether the uppercase letter c

If> = A and <= Z, to use output disp lowercase letters, lower (c) converting the function corresponding uppercase to lowercase

 If> = a and <= z, output disp to use capital letters, upper (c) the corresponding function lowercase to uppercase

If c is not lowercase,> = 0 and <= 9 interpretation is not numeric characters,

Call str2double (c) into a character string function to convert

If you are not

Is output

 

Guess you like

Origin www.cnblogs.com/fanglijiao/p/11106007.html