Here is my code
# define N 10
# define M 10
#include
Int main ()
{
Int a [M] [N], b [M] [N], [M] s, N, I, j;
Int c=0;
The scanf (" % d ", & amp; n);
for(i=0; i
for(j=1; j<=a, [I] [0]. J++)
{the scanf (" % d ", & amp; A [I] [j]);
If (prime (a [I] [j]))
[I] [c] {b=a, [I] [j].
C + +;
}
}
S [I]=c;
c=0;
}
for(i=0; i
for(i=0; i
printf("\n"); }
return 0;
}
Int prime (int) p
{
Int I, f;
If (p
=1)F=0;
The else
{f=1;
for(i=2; iIf I==0) (p %
F=0; }
}
Return the f;
}
Void px (int a [], int n)
{
Int I, j, k, t;
for(i=0; i
{
T=a, [j].
A [j]=a, a + 1 bonus to [j].
A [m + 1]=t;
}
}
CodePudding user response:
# include
#include
# define N 10
# define M 10
Int is_prime (int n)
{
Int I, tm;
If (n & lt; 2)
return 0;
Tm=SQRT (n);
For (I=2; i <=tm; I++)
If I (n %==0)
return 0;
return 1;
}
Arr void the sort (int * and an int size)
{
int i, j;
Int TMP.
For (I=0; iFor (j=0; j If (arr [j] & gt; Arr [m + 1]) {
TMP=arr [j];
Arr=arr [j] [j + 1);
Arr=[m + 1] TMP;
}
}
Void show (int * arr, int size)
{
int i;
For (I=0; iPrintf (" % d ", arr [I]);
Putchar (10);
}
Int main ()
{
Int CNT, len, TMP;
An int array [N].
Int I, j, k;
The scanf (" % d ", & amp; CNT);
For (I=0; iThe scanf (" % d ", & amp; Len);
If (len & gt; N)
Len=N;
K=0;
For (j=0; jThe scanf (" % d ", & amp; TMP);
If (is_prime (TMP))
Array [k++]=TMP;
}
Sort (array, k);
Show (array, k);
}
# if 0
Int a [M] [N], b [M] [N], [M] s, N, I, j;
Int c=0;
The scanf (" % d ", & amp; n);
for(i=0; i{the scanf (" % d ", & amp; A, [I] [0]).
for(j=1; j<=a, [I] [0]. J++)
{the scanf (" % d ", & amp; A [I] [j]);
If (prime (a [I] [j]))
[I] [c] {b=a, [I] [j].
C + +;
}
}
S [I]=c;
c=0;
}
for(i=0; iPx (b [I], [I] s);
for(i=0; i{the for (j=0; j Printf (" % 2 d ", b [I] [j]);
printf("\n"); }
# endif
return 0;
}
# if 0
Int prime (int) p
{
Int I, f;
If (p
=1)F=0;
The else
{f=1;
for(i=2; iIf I==0) (p %
F=0; }
}
Return the f;
}
Void px (int a [], int n)
{
Int I, j, k, t;
for(i=0; ifor(j=0; j If (a [j] & gt; A [m + 1])
{
T=a, [j].
A [j]=a, a + 1 bonus to [j].
A [m + 1]=t;
}
}
# endif
For your reference ~
Topic request is input integers is