当前位置:网站首页>"Daily practice, happy water" 1108 IP address invalidation
"Daily practice, happy water" 1108 IP address invalidation
2022-06-25 04:42:00 【Who eats mints】
List of articles
Try to catch up with the original question :
* A brief introduction to the topic :
Give you an effective IPv4 Address address, Go back to this IP Invalid version of address .
The so-called invalidation IP Address , In fact, it is to use “[.]” Instead of every “.”.
* Their thinking :
- Simulation Dafa is good
- Traversal string , hold
.
Replace with[.]
that will do - over
*C++ Code :
class Solution {
public:
string defangIPaddr(string address) {
string ans;
for (auto c : address) {
if (c == '.') {
ans += "[.]";
} else {
ans.push_back(c);
}
}
return ans;
}
};
Result display :
边栏推荐
猜你喜欢
GBASE 8s 总体架构
php开发支付宝支付功能之扫码支付流程图
2.0springmvc uses restful
LabVIEW development gas regulator
PHP extracts and analyzes table contents, and collects bidding information
Value transfer between parent and child components of wechat applet
高效的NoSQL数据库服务Amozon DynamoDB体验分享
Anaconda安装+TensorFlow安装+Keras安装+numpy安装(包含镜像和版本信息兼容问题)
Gbase 8s index R tree
《牛客刷verilog》Part I Verilog快速入门
随机推荐
After the newly assigned variable of the applet is modified, the original variable will also be modified
GBASE 8s存储过程执行和删除
Trigger for gbase 8s
写shell脚本报错总结
《牛客刷verilog》Part I Verilog快速入门
Anaconda安装+TensorFlow安装+Keras安装+numpy安装(包含镜像和版本信息兼容问题)
Part I Verilog quick start
Structure syntaxique des procédures stockées gbase 8S
Easyrecovery15 very easy to use computer data recovery software
GBASE 8s活锁、死锁问题的解决
小白学习MySQL - 统计的'投机取巧'
Mongodb cluster
30岁了开始自学编程,家里比较困难还来得及吗?
记录小知识点
ROS2/DDS/QoS/主题的记录
华为鸿蒙开发第四课
Basic introduction of gbase 8s blocking technology
Package for gbase 8s
CTF_ Web: advanced problem WP (5-8) of attack and defense world expert zone
多睡觉,能减肥,芝加哥大学最新研究:每天多睡1小时,等于少吃一根炸鸡腿...