over() finished

This commit is contained in:
artem.didytschuk 2020-08-31 23:11:52 +02:00
parent 605a6d2a62
commit 5f0cdf3f89
1 changed files with 10 additions and 1 deletions

View File

@ -329,7 +329,16 @@ public class Arrays {
* Für ein leeres Array wird 0 zurück gegeben.
*/
public int over( int[] pArray, int pValue ) {
return 0;
if( pArray.length == 0 ) {
return 0;
}
int sum =0;
for(int i=0;i<pArray.length;i++){
if(pArray[i]>pValue){
sum++;
}
}
return sum;
}
/**