Advertisement
Guest User

Untitled

a guest
Apr 18th, 2015
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.90 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3. #include <cmath>
  4. #include <complex>
  5. using namespace std;
  6. int p(double q, int p = 2) { return p + q; }
  7. void q(int *&p, int *&q) { cout << *p++ << *q-- << " "; }
  8. double p(double r, double p, int q = 1) { return r - q * p; }
  9. int &r(double (*u)(double), int &v, int &w, int &s) {
  10.  cout << setw(5) << v << w << s << endl;
  11.  cout<<"w="<<w<<"::s="<<s<<"\n";
  12.  v = w + s;
  13.   s = v + w;
  14.  cout<<"v="<<v<<"\n";
  15.  cout << w << "!!"<<v << s << endl;
  16.  w = (*u)(w);
  17.  return v;
  18. }
  19. void s(complex<double> q) { cout << q << endl; }
  20. int main() {
  21.  int u[] = {4, 6, 8, 9, 2, 4, 7, 1, 3, 8};
  22.  int *w(&u[3]), *x(u + 1), *y(w + 6);
  23.  s(2); s(complex<double>(2, 2));
  24.  while(x <= y) q(x, y);
  25.  cout << endl << p(3, 2) << " " << p(2, 3, 3.2) << " " << p(2.3)
  26.  << " " << p(3, 2.) << endl;
  27.  r(sqrt, u[2], *u, w[-1]) += 2;
  28.  cout << w[-1] << " " << *u << " " << u[2] << endl;
  29.  return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement