Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- float takio(int a[])
- {
- float srednia;
- float suma=0;
- float najblizszy=a[0];
- for (int i = 0; i < 20; i++)
- {
- a[i] = rand() % 90 + 10;
- suma = suma + a[i];
- }
- srednia = suma / 20;
- for (int k = 1; k < 20; k++)
- {
- if (abs((srednia - najblizszy)) > abs((srednia - a[k])))
- {
- najblizszy = a[k];
- }
- }
- return najblizszy;
- }
- void kolos1()
- {
- int a[20];
- printf("%f", takio(a));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement