#include using namespace std; void swap1(int a, int b) { int tmp = a; a = b; b = tmp; } void swap2(int *a, int *b) { int tmp = *a; *a = *b; *b = tmp; } void swap3(int &a, int &b) { int tmp = a; a = b; b = tmp; } int kvadrat(const int &x = 0) { return x * x; } inline int kub(int x = 0) { return x * x * x; } inline double kub(double x) { return x * x * x; } int main() { int x = 1, y(3); cout << "Hello, world" << endl; cout << "x = " << x << endl; // bool b; cout << "y = " << y << endl; cin >> x >> y; cout << "x = " << x << endl; cout << "y = " << y << endl; swap1(x, y); cout << "x = " << x << endl; cout << "y = " << y << endl; swap2(&x, &y); cout << "x = " << x << endl; cout << "y = " << y << endl; swap3(x, y); cout << "x = " << x << endl; cout << "y = " << y << endl; /* int n; cout << "Unesi n" << endl; cin >> n; int *niz = new int[n]; for (int i = 0; i < n; i++) niz[i] = i * i; for (int i = 0; i < n; i++) cout << niz[i] << endl; delete [] niz; */ int z = 5; cout << kvadrat(z) << endl; cout << kub(1) << endl; cout << kub(1.1) << endl; return 0; }