/*1. Different points:
SCANF cannot accept space, Tab tab, carriage return, etc.;
And get can accept space, Tab tab and enter, etc.;
2. The same point:
The string is automatically added after the end of the acceptance. With scanf ("%s", &s), there is a problem with the function input string, that is, if a space is entered to assume that the string ends, the character after the space is processed as the next entry, but the Get () function will receive the entire string of input until it encounters a change in behavior.
#include "stdio.h"
#include "string.h"
int l1=0,l2=0; L1 number of lowercase letters, number of L2 capitals
Main ()
{
void Str (char,int);
Char c[100];
int length;
printf ("Please input a string");
/* SCANF ("%s", c); */
Gets (c);
Length=strlen (c);
STR (c,length);
printf ("Number of lowercase letters:%d, capital letters:%d\n", L1,L2);
}
void Str (char b[],int N)
{
int i;
for (i=0;i<n;i++)
if (' A ' <=b[i]&&b[i]<= ' z ') l1++;
else if (' A ' <=b[i]&&b[i]<= ' Z ') l2++;
else if (b[i]= ') continue;
}
C language Gets rain scanf function usage