consolidate all repos to one for archive
This commit is contained in:
16
semester_2/programiranje_2/primeri/Example21/main.cpp
Normal file
16
semester_2/programiranje_2/primeri/Example21/main.cpp
Normal file
@@ -0,0 +1,16 @@
|
||||
#include <iostream>
|
||||
|
||||
template<int N>
|
||||
struct Fact {
|
||||
enum {RET = N * Fact<N-1>::RET};
|
||||
};
|
||||
|
||||
template<>
|
||||
struct Fact<0>{
|
||||
enum {RET = 1};
|
||||
};
|
||||
|
||||
int main() {
|
||||
std::cout << Fact<5>::RET << std::endl;
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user