#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(int x = 0) { return x * x; } int manji(int x, int y) { if (x < y) return x; return y; } double manji(double x, double y) { if (x < y) return x; return y; } int main() { cout << "Hello, world" << endl; /* ovo je bio c-ovski komenatar */ // ovo je c++-ovski komenatar int x(1), y(2); cout << "Unesi x i y"; cin >> x >> y; cout << "x = " << x << endl; cout << "y = " << y << endl; bool t = true; cout << "t = " << t << endl; int *p; p = new int[10]; for (int i = 0; i < 10; i++) p[i] = i; for (int i = 0; i < 10; i++) cout << p[i] << endl; delete [] p; 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; cout << kvadrat(5) << endl; cout << manji(2, 3) << endl; cout << manji(2.2, 3.3) << endl; return 0; }