Advertisement
Cichacz

Ulam

Jan 3rd, 2012
342
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void Ulam(int iloscPar,double &sumaWartosciZwracanych,double (*f)(double), int acc, double a, ...)
  2. {
  3. va_list ap;
  4. va_start(ap,a);
  5.  
  6. sumaWartosciZwracanych=Ulam(f,a,va_arg(ap,double));
  7.  
  8. for(int i=1; i<iloscPar; i++)
  9. {
  10. sumaWartosciZwracanych+=Ulam(f,va_arg(ap,double),va_arg(ap,double));
  11. }
  12.  
  13. va_end(ap);
  14. }
  15.  
  16. void Ulam(int iloscPar,double &sumaWartosciZwracanych,double (*f)(double), int acc, ...)
  17. {
  18. va_list ap;
  19. va_start(ap,acc);
  20.  
  21. sumaWartosciZwracanych=0;
  22.  
  23. for(int i=0; i<iloscPar; i++)
  24. {
  25. sumaWartosciZwracanych+=Ulam(f,va_arg(ap,double),va_arg(ap,double),acc);
  26. }
  27.  
  28. va_end(ap);
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement