This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
#include<bits/stdc++.h>
usingnamespacestd;
intw[5];// 分解数组
boolcheck(stringaddr){
memset(w,-1,sizeofw);
sscanf(addr.c_str(),"%d.%d.%d.%d:%d",&w[0],&w[1],&w[2],&w[3],&w[4]);// ① 按指定格式扫入变量
// 干掉胡乱输入的,比如 33.3423.23423ASFDSDF.sdfsdf
charstr[100];
sprintf(str,"%d.%d.%d.%d:%d",w[0],w[1],w[2],w[3],w[4]);// ② 将变量还原拼接成字符串