Analyzing the lowercase string pointer acquaintance

Papers described
method of inputting a character string without spaces, it requires the use of pointers to traverse the string. And determine whether the string all lowercase letters, then the output is "TRUE", otherwise a "FALSE" (without the quotation marks output).
Input
enter a string without spaces. Enter no more than 999 characters, ending with a carriage return.
Output
meaning of the questions outputs "TRUE" or "FALSE" (without the quotation marks output).
Example input. 1
Apple
output example. 1
TRUE
Input Example 2
Apple%
Output Example 2
FALSE
range of data
input and output are strings, the input character string of no more than 999 characters

#include "stdio.h"
void main()
{
char s[999],*p;
int i,flag=1;
gets(s);
for(p=s;*p!='\0';*p++)
{
if(*p>='a'&&*p<='z')
flag=1;
else{
	flag=0;
	break;
}}
if(flag==1)
printf("%TRUE");
else
printf("FALSE");

}

Guess you like

Origin blog.csdn.net/Lhw_666/article/details/91415121