#include using namespace std; void swap(int x, int y) { int tmp = x; x = y; y = tmp; } void swap1(int *x, int *y) { int tmp = *x; *x = *y; *y = tmp; } void swap2(int &x, int &y) { int tmp = x; x = y; y = tmp; } inline int kvadrat(const int &x = 0) { return x * x; } float kvadrat(const float &x) { return x * x; } int main() { int x = 3; float f = 2.1; x = 3 * 1 + 21; /* sljdflkjds f lsjdflsjdl */ cout << "Hello, world" << endl; cout << "x = " << x << endl; cout << "Unesi f: "; cin >> f; cout << "f = " << f << endl; int y = 1, z = 4; int w(2); int *niz = new int[10]; for (int i = 0; i < 10; i++) niz[i] = i * i; for (int i = 0; i < 10; i++) cout << niz[i] << endl; delete [] niz; cout << "x = " << x << endl; cout << "y = " << y << endl; swap(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; const int jedan = 1; cout << kvadrat(jedan) << endl; cout << kvadrat() << endl; cout << kvadrat(2.2f) << endl; return 0; }