SHOW:
|
|
- or go back to the newest paste.
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 | } |