帮帮我
查看原帖
帮帮我
631547
13146367338hk楼主2025/6/14 09:04
#include<iostream>
using namespace std;
int main()
{
	int a, b, c, light1=0,light2=0,z=0;
	cin>>a;
	for(int i=1;i<=(a-2)/2;i++)
	{
		cout<<2*i+2<<"=";
		for(int j=1;j<=5000;j++)
		{
			c=(2*i+2)-j;
			for(int s=1;s<=c;s++)
			{
				if(c%s!=0)
				{
					light1=1;
				}
			}
			for(int s=1;s<=j;s++)
			{
				if(j%s!=0)
				{
					light2=1;
				}
			}
			if(light1==0&&light2==0)
			{
				cout<<j<<"+"<<c<<endl;
				z=1;
			}
			light1=0;
			light2=0;
			
		}
		
	}
	
	return 0;
}
2025/6/14 09:04
加载中...