Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <complex>
- using namespace std;
- double p(double x, int y = 0) {
- return 2 * x + 3 * y;
- }
- int q(int &y) {
- y--; return y * 2;
- }
- double p(int x) {
- return 3 * x;
- }
- int r(int &z) {
- ++z; return z - 1;
- }
- void s(int &x, int y, int z(int &x)) {
- x += z(y);
- cout << complex<double>(x++, y) << endl;
- }
- int main() {
- int (*t[3])(int &x) = {q, r, q};
- int y(3), z(4);
- cout << p(2) << "," << p(2.) << "," << p(2, 2) << endl;
- for(int x = 0; x < y; x++) s(z, x, t[x]);
- cout << z << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement