主要是输入处理哈
总感觉还有什么坑,
ac代码
#include <iostream>
#include <stdio.h>
using namespace std;
int main(){
int a,b,c,d;
int n;
char str[100];
while(cin>>str){
sscanf(str,"%d.%d.%d.%d",&a,&b,&c,&d);
if((a>=0&&a<=255)&&(b>=0&&b<=255)&&(c>=0&&c<=255)&&(d>=0&&d<=255))
cout<<"Yes!"<<endl;
else
cout<<"No!"<<endl;
}
return 0;
}