垃圾题求助
查看原帖
垃圾题求助
199459
Masna_Kimoyo楼主2021/10/17 13:43

帮帮我吧神仙们,我都不知道是我的问题还是SPJ的问题qwq

n=123的时候有不是-1的情况吗

#include<bits/stdc++.h>
using namespace std;
inline int read()
{
	int x=0;
	bool w=0;
	char c=getchar();
	while(!isdigit(c))	w|=c=='-',c=getchar();
	while(isdigit(c))	x=(x*10)+c-48,c=getchar();
	return w?-x:x;
}
int main()
{
//	freopen(".in","r",stdin);
//	freopen(".out","w",stdout);
	int n=read();
	if(n<=7)	cout<<-1;
	else
	{
		printf("1 2\n2 3\n1 4\n4 5\n5 6\n6 7\n");
		for(register int i=8;i<=n;++i)
			cout<<1<<' '<<i<<endl;
	}
	return 0;
}

2021/10/17 13:43
加载中...