#include <stdio.h>
int Tribonacci(int n){
if(n >= 3){
return Tribonacci(n - 1) + Tribonacci(n - 2) + Tribonacci(n - 3);
} else if (n == 1 || n == 2){
return 1;
} else {
return 0;
}
}
int main() {
int x, trib;
scanf("%d", &x);
trib = Tribonacci(x);
printf("%d", trib);
}
To embed this project on your website, copy the following code and paste it into your website's HTML: