14 lines
196 B
C++
14 lines
196 B
C++
#include <iostream>
|
|
|
|
consteval int foo(int x) {
|
|
if (x <= 1) return x;
|
|
return foo(x - 1) + foo(x - 2);
|
|
}
|
|
|
|
int main() {
|
|
constexpr int x = foo(3);
|
|
|
|
static_assert(x != foo(4));
|
|
|
|
return 0;
|
|
}
|