请求增加hack数据,自己hack自己
查看原帖
请求增加hack数据,自己hack自己
1382405
zzyycc2013楼主2025/1/15 09:23

我的代码:

#include<bits/stdc++.h>
using namespace std;
string s;
long long cnt=0,n;
bool f=1;
int main(){
    cin>>n;
    while(cin>>s)
	{
        f=1;
        int k=s.size();
		if(s[0]<'A'||s[0]>'Z')f=0;
		else{
			for(int i=1;i<s.size();i++){
				if(s[k-1]=='.'||s[k-1]=='?'||s[k-1]=='!')continue;
				if((s[i]<'a'||s[i]>'z'))f=0;
			}
		}
		cnt+=f;
		if(s[k-1]=='.'||s[k-1]=='?'||s[k-1]=='!'){
			cout<<cnt<<"\n";
			cnt=0;
		}
    }
    return 0;
}

hack数据: 输入:

1
BeN.

输出:

0
2025/1/15 09:23
加载中...