Home > Back-end >  Enter two positive integers not equal, and two positive integers range (including the two positive i
Enter two positive integers not equal, and two positive integers range (including the two positive i

Time:09-26

CodePudding user response:

Have a great god solve

CodePudding user response:

After another wall bumps by top

CodePudding user response:

by bumps bumps

CodePudding user response:

# include & lt; stdio.h>

Int IsPrime (int x)
{
If (x & lt; 2) return 0;
For (int I=2; i {
If (x % I==0)
return 0;
}
return 1;
}

Void PrintPrime (int m, int n)
{
int count=0;
Int k=0;
For (int I=m; i <=n; I++)
{
If (IsPrime (I))
{
Printf (" % d ", I);
K++;
count++;
}
If (k==5)
{
printf("\n");
K=0;
}
}
if(! The count) printf (" no prime in the area ");
}

Int main ()
{
Int m, n;
Printf (" input two number: ");
The scanf (" % d % d ", & amp; M, & amp; N);
If (m & lt; N)
{
PrintPrime (m, n);
}
The else
{
PrintPrime (n, m);
}
return 0;
}

CodePudding user response:

C + + environment, only the output of the output

CodePudding user response:

Is not what I mean is that the output use commas in the middle
  • Related