蒟蒻求助
查看原帖
蒟蒻求助
341245
Sunflower_ac楼主2020/11/22 16:13

麻烦帮忙看看这道题错哪了?

#include<iostream>
#include<cstring>
#include<cmath>
using namespace std;
int tot[10005][10005];
int main()
{
	int x[10],y[10];
	while(cin>>x[1]>>y[1])
	{
		memset(tot,0,sizeof(tot));
		int h=x[1],f=y[1];
		x[1]=max(h,f);
	    y[1]=min(h,f);
		tot[x[1]][y[1]]++;
		for(int i=2;i<=6;i++)
		{
			cin>>x[i]>>y[i];
			int m=x[i],n=y[i];
			x[i]=max(m,n);
			y[i]=min(m,n);
		    tot[x[i]][y[i]]++;
		}
		int k=0;
		for(int i=1;i<=10000;i++)
		{
			for(int j=1;j<=i;j++)
			  if(tot[i][j]>=2&&tot[i][j]%2==0)k+=tot[i][j];
		}
		if(k==6) cout<<"POSSIBLE"<<endl;
		else cout<<"IMPOSSIBLE"<<endl;
	 } 
	return 0;
 } 
2020/11/22 16:13
加载中...