日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

蛤玮学计网 -- 简单的判断ip

發布時間:2025/3/18 编程问答 23 豆豆
生活随笔 收集整理的這篇文章主要介紹了 蛤玮学计网 -- 简单的判断ip 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

心累 , 狗日的想了好多數據 , ......啥也不說了 我去哭一會 .?

1 #include<stdio.h> 2 #include<string.h> 3 #include<math.h> 4 #include<iostream> 5 #include<limits.h> 6 #include<algorithm> 7 #include<queue> 8 #include<vector> 9 #include<set> 10 #include<stack> 11 #include<string> 12 #include<sstream> 13 #include<map> 14 #include<cctype> 15 using namespace std; 16 // 1 , 三個點 17 // 2 , 判斷數字是否在范圍內 18 // 3 , 字母的話 不合題意 19 // 4 , 最多三個數 20 int main() 21 { 22 int t; 23 char a[55]; 24 scanf("%d",&t); 25 while(t--) 26 { 27 scanf("%s",a); 28 int l=strlen(a),flag=1; //默認 可以 29 int sum=0,count1=0,time=0; 30 for(int i=0;i<l;i++) 31 { 32 if(a[i]=='.') 33 { 34 if(sum<0||sum>255) 35 flag=0; 36 if(time==0||time>3) //判斷兩個點之間 數字的個數 是否符合要求 37 flag=0; 38 time=sum=0; 39 count1++; 40 continue; 41 } 42 if(!(a[i]>='0'&&a[i]<='9')) //如果不是 0 - 9 的話 43 flag=0; // 出現字母啥都別說了 .... 44 sum=sum*10+a[i]-'0'; 45 time++; 46 } 47 if(count1!=3) 48 flag=0; 49 if(flag) 50 printf("Yes\n"); 51 else 52 printf("No\n"); 53 } 54 return 0; 55 }

?

轉載于:https://www.cnblogs.com/A-FM/p/5404405.html

總結

以上是生活随笔為你收集整理的蛤玮学计网 -- 简单的判断ip的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。