Problem: In this problem, you need to check if a given finite sequence appears as a sub-sequence in the Fibonacci sequence. A finite sequence is said to be a Fibonacci sub-sequence if it is contained in the Fibonacci sequence in the same relative order but not necessarily consecutively. 
For example, the finite sequence 2, 5, 8 is a Fibonacci sub-sequence.  But 2, 8, 5 is not. Write a C++ program to accept an integer M followed by a finite sequence of M numbers. Your task is to determine if this finite sequence is a Fibonacci sub-sequence. You should output the following:
●	true or false
○	true: if the given finite sequence is a Fibonacci sub-sequence. E.g. on inputs “3 3 8 13”  and “3 3 5 8”
○	false  otherwise
Input Format An integer M followed by M integers

Assumptions on Input
●	Assume that the integer M will be between 1 and 19, both inclusive 
●	Assume that the sub-sequence numbers will be between 0 and 5000, both inclusive

Student submission:
#include <simplecpp>


int check(int a){
    int output;
if (a == 0 || a == 1 || a == 2 || a == 3 || a == 5 || a == 8 || a == 13 || a == 21 || a == 34 || a == 55 || a == 89 || a == 144 || a == 233 || a == 377 || a == 610 || a == 987 || a == 1597 || a == 2584 || a == 4181){output=0;}

if (a != 0 && a != 1 && a != 2 && a != 3 && a != 5 && a != 8 && a != 13 && a != 21 && a != 34 && a != 55 && a != 89 && a != 144 && a != 233 && a != 377 && a != 610 && a != 987 && a != 1597 && a != 2584 && a != 4181){output=1;}
return output;
};
main_program{
int M; cin >>  M;
int a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19;
if(M == 1){cin >> a1;};
if(M == 2){cin >> a1 >> a2;};
if(M == 3){cin >> a1 >> a3;};
if(M == 4){cin >> a1 >> a2 >> a3 >> a4;};
if(M == 5){cin >> a1 >> a2 >> a3 >> a4 >> a5;};
if(M == 6){cin >> a1 >> a2 >> a3 >> a4 >> a5 >> a6;};
if(M == 7){cin >> a1 >> a2 >> a3 >> a4 >> a5 >> a6 >> a7;};
if(M == 8){cin >> a1 >> a2 >> a3 >> a4 >> a5 >> a6 >> a7 >> a8;};
if(M == 9){cin >> a1 >> a2 >> a3 >> a4 >> a5 >> a6 >> a7 >> a8 >> a9;};
if(M == 10){cin >> a1 >> a2 >> a3 >> a4 >> a5 >> a6 >> a7 >> a8 >> a9 >> a10;};
if(M == 11){cin >> a1 >> a2 >> a3 >> a4 >> a5 >> a6 >> a7 >> a8 >> a9 >> a10 >> a11;};
if(M == 12){cin >> a1 >> a2 >> a3 >> a4 >> a5 >> a6 >> a7 >> a8 >> a9 >> a10 >> a11 >> a12;};
if(M == 13){cin >> a1 >> a2 >> a3 >> a4 >> a5 >> a6 >> a7 >> a8 >> a9 >> a10 >> a11 >> a12 >> a13;};
if(M == 14){cin >> a1 >> a2 >> a3 >> a4 >> a5 >> a6 >> a7 >> a8 >> a9 >> a10 >> a11 >> a12 >> a13 >> a14;};
if(M == 15){cin >> a1 >> a2 >> a3 >> a4 >> a5 >> a6 >> a7 >> a8 >> a9 >> a10 >> a11 >> a12 >> a13 >> a14 >> a15;};
if(M == 16){cin >> a1 >> a2 >> a3 >> a4 >> a5 >> a6 >> a7 >> a8 >> a9 >> a10 >> a11 >> a12 >> a13 >> a14 >> a15 >> a16;};
if(M == 17){cin >> a1 >> a2 >> a3 >> a4 >> a5 >> a6 >> a7 >> a8 >> a9 >> a10 >> a11 >> a12 >> a13 >> a14 >> a15 >> a16 >> a17;};
if(M == 18){cin >> a1 >> a2 >> a3 >> a4 >> a5 >> a6 >> a7 >> a8 >> a9 >> a10 >> a11 >> a12 >> a13 >> a14 >> a15 >> a16 >> a17 >> a18;};
if(M == 19){cin >> a1 >> a2 >> a3 >> a4 >> a5 >> a6 >> a7 >> a8 >> a9 >> a10 >> a11 >> a12 >> a13 >> a14 >> a15 >> a16 >> a17 >> a18 >> a19;};

if(a1 < a2 < a3 <a4 < a5 < a6 < a7 < a8 < a9 < a10 < a11 < a12 < a13 < a14 < a15 < a16 < a17 < a18 < a19)
{
    if (check(a1) == 1 || check(a2) == 1 || check(a3) == 1 || check(a4) == 1 || check(a5) == 1 || check(a6) == 1 || check(a7) == 1 || check(a8) == 1 || check(a9) == 1 || check(a10) == 1 || check(a11) == 1 || check(a12) == 1 || check(a13) == 1 || check(a14) == 1 || check(a15) == 1 || check(a16) == 1 || check(a17) == 1 || check(a18) == 1 || check(a19) == 1 ){cout << "false";};

if (check(a1) == 0 && check(a2) == 0 && check(a3) == 0 && check(a4) == 0 && check(a5) == 0 && check(a6) == 0 && check(a7) == 0 && check(a8) == 0 && check(a9) == 0 && check(a10) == 0 && check(a11) == 0 && check(a12) == 0 && check(a13) == 0 && check(a14) == 0 && check(a15) == 0 && check(a16) == 0 && check(a17) == 0 && check(a18) == 0 && check(a19) == 0 ){cout << "true";};

    




}







 }

Grading criterion: Output
Rating A: correctly prints the output
Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: C