Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - How to judge whether an input is plastic in C++
How to judge whether an input is plastic in C++
Enter a string instead, and judge whether it belongs to shaping through character variables.

involve

# include & ltiostream & gt

Use namespace std

Boolean check (char *str)

{

& ampnbs pint I;

& ampnbsp for(I = 0; I & ltstrlen(str);); i++)

& ampnbs pif(str[I]& lt; 0 ' | | str[I]& gt;' 9' )

& ampnbspreturn false

& nbs returns true.

}

int main()

{

& ampnbsp char str[30];

& ampnbsp while(CIN & gt; & gtstr)

{

& ampnbspif ( check( str))

& ampnbspbreak

}

& ampnbspcout & lt& ltstr

& ampnbs return 0;

}