funkce
inline int plus (int a, int b) { return a+b; }
int max (int a, int b) { if (a > b) { return a; } else { return b; } }
int max (int a, int b) { int v = 0; if (a > b) { v = a; } else { v = b; } return v; }
</code c++> #include <iostream> using namespace std;
int fakt (int n) {
int v = 1; for (int k = 1; k <= n; k++) { v = v * k; } return v;
}
int main(int argc, char** argv) {
for (int i = 1; i <= 12; i++) { cout << i << "! je " << fakt (i) << endl; } return 0;
} </code>
funkce.txt · Last modified: 2019/09/26 13:01 by 127.0.0.1