fork download
  1. #include <iostream>
  2. using namespace std;
  3. int main ()
  4. {
  5. float p=0;
  6. int a[]={2,3,4,8,9,7,8,5};
  7. for (int i = 0; i<8; i++)
  8. {
  9. if (a[i]%2 !=0)
  10. {
  11. p=(p+a[i])/8;
  12.  
  13. }
  14. }
  15. cout << p;
  16. return 0;
  17. }
Success #stdin #stdout 0s 3412KB
stdin
Standard input is empty
stdout
0.752686