80分!求调!!!
查看原帖
80分!求调!!!
845976
dyx05221129楼主2024/6/25 20:48
#include <bits/stdc++.h>
using namespace std;
int a, b, c;
int h, j;
int isprime(int x)
{
	for(int i = 2; i < x; i++)
	{
		if(x % i == 0)
			return false;
	}
	return true;
}
int main()
{
	cin >> a >> b;
	for(int i = 0 ; i < b-a; i++)
	{
		c = a+i;
		if(isprime(c))
		{
			h = c / 10;
			j = c % 10;
			c = j*10 + h;
			if(isprime(c))
				cout << a+i << endl;
		}
	}
	return 0;
}

不知错在哪里QWQ

2024/6/25 20:48
加载中...