static bool Issu(int number){
bool isSu = true;
for (int j = 2;j< nunber-1;j++)//2~i-1
{
if(number %j=0){
isSu = false;
return issu;
}
}
return issu;
}
static bool Issu(int number){
bool isSu = true;
for (int j = 2;j< nunber-1;j++)//2~i-1
{
if(number %j=0){
isSu = false;
return issu;
}
}
return issu;
}
static bool IsSu(int number)
{
bool isSu = true;
for (int j = 2; j < number-1; j++)
{
if (number% j == 0)
{
isSu = false;
break;
}
}
return isSu;
}
static int opposite(int number)//反序
{
int temp = number;
int num = 0;
while (temp % 10 != 0)//反序
{
num = num * 10 + temp % 10;
temp = temp / 10;
}
return num;
}
static void test01()
{
string str = Console.ReadLine();
string[] strArray = str.Split(' ');
int[] intArray = new int[strArray.Length];
for (int j = 0; j < strArray.Length; j++)
{
int number = Convert.ToInt32(strArray[j]);
intArray[j] = number;
}
int m = intArray[0];
int n = intArray[1];
for (int i = m; i <= n; i++)
{
bool isSu =IsSu(i);
//for (int j = 2; j < i; j++)
//{
// if (i % j == 0)
// {
// issu = false;
// break;
// }
//}
if (isSu)
{
//int temp = i;
//int num = 0;
//while (temp % 10 != 0)//反序
//{
// num = num * 10 + temp % 10;
// temp = temp / 10;
//}
int temp = i;
int num = opposite(temp);
bool isSuFan = IsSu(num);
//for (int j = 2; j < num; j++)
//{
// if (num % j == 0)
// {
// isSuFan = false;
// break;
// }
//}
if (isSuFan == true)
{
Console.Write(i + " ");
}
}
}
}
return 用来结束当前函数,并把某个结果返后
搞清楚素数那一章