Method for judging whether a character in a string is a letter or a number

Record it, if you want to judge by hand, it is still very easy to use. For her own convenience, for her convenience! Hahaha.
int main()
{ char s[6]; int c,n,m; c = n = m =0; for(int i = 0;i<6; i ++) { if(s[i]>= '0' && s[i] <= '9' && n == 0) n == 1; else if((s[i]>='a' && s[i] <='z') && c == 0) c == 1; else if ((s[i]>='A' && s[i] <='Z') && m == 0) m == 1; } if(n == 1 && c == 1 && m == 1) return true;













return  false;

}

Guess you like

Origin blog.csdn.net/weixin_44881103/article/details/103820483