解题思路:用到isalpha()来判断是不是字母
注意事项:
参考代码:
while(1):
na,nb,nc,nd=input().split('.')
count=0
num=0
L=[na,nb,nc,nd]
for i in L:
if i.isalpha()==False :#不是字母
if int(i)>0 and int(i)<=255:
count+=1
if count==4 :
print('Y')
else:
print('N')
0.0分
0 人评分
简单编码 (C++代码)浏览:678 |
2004年秋浙江省计算机等级考试二级C 编程题(1) (C语言代码)浏览:467 |
C语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:485 |
WU-输出九九乘法表 (C++代码)浏览:1678 |
用筛法求之N内的素数。 (C语言代码)浏览:658 |
2003年秋浙江省计算机等级考试二级C 编程题(2) (C语言代码)浏览:597 |
The 3n + 1 problem (C语言代码)浏览:554 |
C语言程序设计教程(第三版)课后习题5.5 (C语言代码)浏览:559 |
C二级辅导-等差数列 (C语言代码)浏览:724 |
计算质因子 (C语言代码)浏览:708 |