Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # include <iostream>
- # include <cstdio>
- using namespace std;
- double Suma(double tab[], int x){
- double sum = 0;
- for(int i=0; i <x; i++)
- {
- sum += tab[i];
- }
- return sum;
- }
- int F(double*tab, int x){
- int a=0, i=0;
- double srednia;
- double b = Suma( tab, x);
- srednia = b/x;
- cout << srednia << endl;
- do
- {
- if (srednia>tab[i])
- a++;
- i++;
- } while (i<x);
- return a;
- }
- int main()
- {
- double tab[] = {4,7,2,7,6};
- cout << F(tab,5) << endl;
- system ("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement