Guest User

Untitled

a guest
Apr 25th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. double x(lp head) {
  2. int n,ossz=0,szamlal=0;
  3. lp spot;
  4. for(spot=head;spot!= NULL; spot = spot->next) {
  5. if(spot->n%2!=0) {
  6. ossz+=spot->n;
  7. szamlal++;
  8. }
  9. }
  10. return ossz/szamlal;
  11. }
  12.  
  13. int main() {
  14. lp head=init();
  15. double atlag;
  16. atlag=x(head);
  17. printf("%f\n",atlag);
  18. return 0;
  19. }
Add Comment
Please, Sign In to add comment