#include<iostream>
#include<string>
using namespace std;
int main()
{
string str2,str3;
char*str1=new char[100];
gets(str1);
int len1=strlen(str1);
str1[len1]='\0';
if (len1==0||len1==3)
{
if (len1==3)
{
for (int i=0;i<3;i++)
{
if (str1[i]-'0'>9||str1[i]-'0'<0)
{
cout<<1<<endl;
return 0;
}
}
}
}
else
{
cout<<1<<endl;
return 0;
}
cin>>str2;
int len2=str2.length();
if (len2!=3)
{
cout<<1<<endl;
return 0;
}
else
{
if (str2[0]=='0')
{
cout<<1<<endl;
return 0;
}
else
{
for (int j=0;j<3;j++)
{
if (str2[j]-'0'>9||str2[j]-'0'<0)
{
cout<<1<<endl;
return 0;
}
}
}
}
cin>>str3;
int len3=str3.length();
if (len3!=4)
{
cout<<1<<endl;
return 0;
}
else
{
for (int k=0;k<4;k++)
{
if (str3[k]-'0'>9||str3[k]-'0'<0)
{
cout<<1<<endl;
return 0;
}
}
}
cout<<0<<endl;
return 0;
}
2015华为机试练习【测试自动化6】城市电话号码
最新推荐文章于 2023-06-03 21:54:41 发布