#include #include #include using namespace std; /* lsjdfkjls */ // slkdjflksdjf 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; } int kvadrat(const int &x) { return x * x; } int f(int x = 111) { return x + 1; } inline double f(double y) { return y + 2; } int main() { int n(3); int *niz; cout << "Hello, world" << endl; cout << "Dimenzija niza: "; cin >> n; 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 x = 1, y = 2; 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; x = 10; cout << "x ^ 2 = " << kvadrat(x) << endl; const int d = 10; cout << "d ^ 2 = " << kvadrat(d) << endl; cout << "f(x) = " << f(x) << endl; cout << "f() = " << f() << endl; double r = 2.3; cout << "f(r) = " << f(r) << endl; cout << "isdigit('7') = " << isdigit('7') << endl; cout << "isdigit('a') = " << isdigit('a') << endl; exit(EXIT_SUCCESS); }