To the output, (prime Numbers: in a natural number greater than 1, besides 1 and itself, there will be no other factor)
CodePudding user response:
# include & lt; Bits/stdc++. H>
using namespace std;
Int rryl [3] [4]={{1, 2, 3, 4}, {5,6,7,8}, {9,10,11,12}};
Bool isprime (int a) {
For (int I=2; iIf I==0) (a % {
return false;
}
}
return true;
}
Int main () {
Int CNT=0;
Double sum=0;
Double pj.//the mean
for(int i=0; i<3; + + I) {
for(int j=0; j<4. + + j) {
If (isprime (rryl [I] [j])) {
The sum +=rryl [I] [j];
+ + CNT;
Cout & lt;}
}
}
Pj=sum/CNT;
Cout & lt;Cout & lt; Cout & lt; return 0;
}