Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- double x(lp head) {
- int n,ossz=0,szamlal=0;
- lp spot;
- for(spot=head;spot!= NULL; spot = spot->next) {
- if(spot->n%2!=0) {
- ossz+=spot->n;
- szamlal++;
- }
- }
- return ossz/szamlal;
- }
- int main() {
- lp head=init();
- double atlag;
- atlag=x(head);
- printf("%f\n",atlag);
- return 0;
- }
Add Comment
Please, Sign In to add comment