首页
DreamJudge
院校信息
考研初试
考研复试
保研专区
讨论区
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
AORIE
2026年3月26日 10:38
IP地址 题解:贴个C的,通俗
P1023
回复 0
|
赞 2
|
浏览 44
#include <stdio.h> #include <string.h> char a[10005]; int cnt[27]; int main(){ gets(a); int k =strlen(a); int cnt_point=0; for(int i=0;i<k;i++){ if(a[i]=='.'){ cnt_point++; } else if(!(a[i]>='0'&&a[i]<='9')){ printf("Error"); return ...
HKX9XAS
2026年3月20日 14:48
IP地址 题解:手动转进制
P1023
回复 0
|
赞 4
|
浏览 117
#include<stdio.h> #include<malloc.h> #include<iostream> #include<math.h> #include<stack> #include<string> #include<map> #include<algorithm> using namespace std; int string_to_num(string nt){ //字符串转为十进制数值 int n...
ZeroQi_404
2026年3月8日 21:33
IP地址 题解:
P1023
回复 0
|
赞 23
|
浏览 336
#include<iostream> #include<string> #include<cstdio> using namespace std; int main(){ string s; cin >> s; int a,b,c,d; char x,y,z; if(sscanf(s.c_str(), "%d.%d.%d.%d%c", &a,&b,&c,&d,&x) != 4){ cout<<"...
sadhjksdj
2026年3月4日 16:21
IP地址 题解:
P1023
回复 0
|
赞 12
|
浏览 222
#include<bits/stdc++.h> using namespace std; //判断ip地址是否合法 bool isValid(string s){ int count = 0; //记录中间.的个数 string num; //记录点中间的数字 for(int i = 0;i<s.length();i++){  ...
苏荷和
2026年3月2日 14:27
IP地址 题解:不用复杂判断,不用类型转换
P1023
回复 0
|
赞 26
|
浏览 402
#include <iostream> #include <algorithm> using namespace std; char t[20]="0123456789ABCDEF";//用于映射16进制 void func(int x) { int a=x/16, b=x%16; cout << t[a]; cout << t[b]; } bool ip(int a, int b, int c, int d) {//检查ip是否是0-255 if (a > 255 || a < 0) retur...
mlx
2026年2月9日 10:57
IP地址 题解:
P1023
回复 0
|
赞 7
|
浏览 281
#include<iostream> #include<algorithm> using namespace std; const int N=10; string str; bool check() { int cnt=0,num=0; for(int i=0;i<str.size();i++) { if(str[i]=='.') { cnt++; if(num>255) return false; num=0; } else { if(s...
曾不会
2026年1月27日 10:36
IP地址 题解:80%的题,还有什么没考虑到呢
P1023
回复 0
|
赞 1
|
浏览 360
while(1): try: num = list(map(str, input().split("."))) if (len(num) != 4): print("Error") continue flag=1 for i in num: # print(len(i)) if(i.isdigit()): if(len(i)&g...
leo110
2025年6月8日 15:25
IP地址 题解:合法情况很好考虑,不合法的情况一大堆
P1023
回复 0
|
赞 11
|
浏览 935
#include<iostream> #include<sstream> #include<algorithm> #include<map> using namespace std; //int->char用map实现 map<int,char> M={{0,'0'},{1,'1'},{2,'2'},{3,'3'},{4,'4'},{5,'5'},{6,'6'},{7,'7...
carrot_huan
2025年3月18日 19:13
IP地址 题解:重新做了一遍,有三个关键点,求16进制,判断合法,输出
P1023
回复 0
|
赞 9
|
浏览 2.4k
#include<algorithm> #include<vector> #include<iostream> #include<string> #include<cstdio> using namespace std; string stander = "0123456789ABCDEF"; bool Judge(string str) { for (char i : str) &n...
zxjrheaven
2025年3月14日 14:49
IP地址 题解:暴力
P1023
回复 0
|
赞 6
|
浏览 1.2k
#include <bits/stdc++.h> using namespace std; void shuchu(int a) { if(a>=0&&a<=9) { char zm1='0'+a; cout<<zm1; } ...
1
2
3
题目
IP地址
题解数量
30
发布题解
在线答疑
热门题解
1
ip地址(C)
2
IP地址 题解:新手易懂方法+易错总结
3
IP地址 题解:不用复杂判断,不用类型转换
4
IP地址 题解:
5
IP地址 题解:
6
IP地址 题解:
7
IP地址 题解:合法情况很好考虑,不合法的情况一大堆
8
题解:IP地址
9
IP地址 题解:纯暴力
10
IP地址 题解:重新做了一遍,有三个关键点,求16进制,判断合法,输出补0