Function: enter a string to determine whether it is a return.
Mainly exercise pointer usage.
1. C Edition
# Include <stdio. h> he [I =, flag = (a = getchar ())! ==++ N = (I =; I <n/; I ++, he [I], he [n -- (he [I]! = He [n --); (flag =
The getchar () function obtains an input in sequence, assigns it to the char variable a, and then assigns it to the char array he [] through a.
When "\ n" is input, that is, the Return key jumps out of the loop.
2. C ++
# Include <iostream> <. h> main (* p = n = flag = (I =; I <n /; I ++ <p [I] <p [n -- I] <(p [I]! = P [n -- = <endl; (flag = <
Strlen () Get the length
3. C function call Edition
# Include <stdio. h> <. h> pp (* n = (p = NULL)-(I =; I <n/; I ++ (p [I]! = P [n -- * p = a =
Pp () is an int-type function, so an int-type value is returned. It is received by declaring an int a in the main function.