大lao帮我看看我的屎山meituan-001为啥只过了一个用例
提目:https://leetcode.cn/problems/BaR9fy/
#include<iostream>
using namespace std;
int main()
{
//cout << "先输入循环次数再给爷几个数:";
string temp;
int temp2,temp3;
int l;
start:;
cin >> l;//题意输入几个名字
if (!cin) { cout << "Wrong"<<endl;cin.clear(); cin.ignore(1024, '\n');goto start; }
for (int i = 0; i < l; i++)//题意输入几个名字就循环几次
{
cin >> temp;
if (!cin) { cout << "Wrong"<<endl; cin.clear(); cin.ignore(1024, '\n'); continue; }
int shuzi_num = 0;
int zimu_num = 0;
int succeed=0;
for (int i = 0; i < temp.size(); i++)
{
succeed=0;
temp2= temp[i];//字符转ascii数字
temp3 = temp[0];
if (temp.size() >= 20) { cout << "Wrong"<<endl; break; }//字符多于20就break
if(temp3<65 || temp3> 90)
if (temp3 < 97 || temp3> 122)
{ cout << "Wrong"<<endl; break; }//开头不是大小写字母就break
if (48 <= temp2 && temp2 <= 57) { shuzi_num += 1; }
if ((65 <= temp2 && temp2 <= 90 )|| (97 <= temp2 && temp2 <= 122)) { zimu_num += 1; }
//if (i == 0)continue;//第一次循环不需要走下去不然bug
if (temp2 < 48 || temp2 > 57)//判断是不是数字
if (temp2 < 65 || temp2> 90)
if (temp2 < 97 || temp2> 122)//判断是不是字母
{
cout << "Wrong"<<endl; break;//第二项往后开始不是字母数字就break
}
//往下只能是i=1之后和数字大小写字母
if (48 <= temp2&& temp2 <= 57)shuzi_num+=1;//记录有几个数字
if ((65 <= temp2&& temp2 <= 90) || (97 <= temp2&&temp2 <= 122))zimu_num += 1;//记录有几个字母
if(i== temp.size()-1)
if (shuzi_num == 0 || zimu_num == 0) { cout << "Wrong"<<endl; break; }//用户名需要包含至少一个字母和一个数字
succeed = 1;
}
if (succeed == 0)continue;
if (succeed == 1)cout << "Accept"<<endl;
}
return 0;
}