头一次被 入门 题卡到怀疑人生,谁来帮帮我!(40pts
#include<bits/stdc++.h>
using namespace std;
int a[6];
int b[6];
int t;
bool ch(){
if(b[1]+1 == b[2] && b[2]+1==b[3] && b[4]==b[5])return 1;
if(b[1] == b[5] && b[2]+1==b[3] && b[3]+1==b[4])return 1;
if(b[3]+1 == b[4] && b[4]+1==b[5] && b[1]==b[2])return 1;
return 0;
}
int main(){
cin>>t;
for(int i=1;i<=t;i++){
for(int j=1;j<=4;j++)
cin>>a[j];
bool flag=0;
for(int j=0;j<=9;j++){
a[5]=j;
for(int k=1;k<=5;k++)
b[k]=a[k];
sort(b+1,b+5+1);
if(ch()){
cout<<1<<endl;
flag=1;
break;
}
}
if(!flag)cout<<0<<endl;
}
}