#include <stdio.h> #include <string.h> main() { char zf[100],ch; int a,b=0,c; gets(zf); c=strlen(zf); if(c!=11 || zf[0]!='1') b=1; for(a=0;a<11;a++) { if(!(zf[a]>='0' && zf[a]<='9')) b=1; } if(b==0) printf("是合法的手机号"); else printf("不是合法的手机号"); getchar(); }
标签:11,判断,手机号,zf,C语言,ch,include From: https://www.cnblogs.com/xkdn/p/17059891.html