#include<stdio.h> #include<string.h> int check_fibonacci(int fibonacci[], int total) { int i, j, result, sum; for(i = 0, j = 2; i < total - 2; i++,j++) { sum = fibonacci[i] + fibonacci[i+1]; if(fibonacci[j] == sum) { result = 1; } else { result = 0; } } return result; } void main() { int total; printf("co bao nhieu so : "); scanf("%d", &total); int fibonacci[total]; for(int i = 0; i < total; i++) { printf("fibonacci %d = ", i + 1); scanf("%d", &fibonacci[i]); } if(check_fibonacci(fibonacci, total) == 1) { printf("\nla day so fibonacci"); } else { printf("\nkhong phai day so fibonacci"); } }