题目
#include<bits/stdc++.h>
using namespace std;
string s;
int n,p[10005];
int main(){
cin>>n;
for(int i=1;i<=n;i++){
int c;
cin>>c;
string t;
for(int j=1;j<=c;j++){
cin>>s;
t+=s;
}
for(int j=0;j<t.size()-1;j++){
if(t[j]>t[j+1]){
p[i]=1;
break;
}
else p[i]=0;
}
}
for(int i=1;i<=n;i++){
if(p[i]==1) cout << 0 << endl;
else cout << 1 << endl;
}
return 0;
}
样例过
为什么错???