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>
bool termcheck(int &a){
        int f0=0, f1=1;
        int fp=f1, fpp=f0, fn;
        bool k;
        while(a<=fn){
                  fn = fp + fpp;
                  fpp = fp;
                  fp= fn;
                }
        if(a=fn) k=true;
        else k=false;
        return k;}

main_program{
        int M;
        if(M==1){
                int a1;
                cin>>a1;
                if (termcheck(a1)==true) cout << "true";}
                else cout << "false";
        if(M==2){
                int a1, a2;
                cin >> a1 >> a2;
                if(a1<a2) {
                    if(termcheck(a1)==true&&termcheck(a2)==true) cout << "true";
                }
                else cout << "false";}
        if(M==3){
                int a1, a2, a3;
                cin >> a1 >> a2 >> a3;
                if(a1<a2<a3) {
                    if(termcheck(a1)==true&&termcheck(a2)==true&&termcheck(a3)==true) cout << "true";
                }
                else cout << "false";}
        if(M==4){
                int a1, a2, a3, a4;
                cin >> a1 >> a2>>a3>>a4;
                if(a1<a2<a3<a4) {
                    if(termcheck(a1)==true&&termcheck(a2)==true&&termcheck(a3)==true&&termcheck(a4)==true) cout << "true";
                }
                else cout << "false";}
        if(M==5){
                int a1, a2, a3, a4, a5;
                cin >> a1 >> a2>>a3>>a4>>a5;
                if(a1<a2<a3<a4<a5) {
                    if(termcheck(a1)==true&&termcheck(a2)==true&&termcheck(a3)==true&&termcheck(a4)==true&&termcheck(a5)==true) cout << "true";
                }
                else cout << "false";}
        if(M==6){
                int a1, a2, a3, a4, a5, a6;
                cin >> a1 >> a2>>a3>>a4>>a5>>a6;
                if(a1<a2<a3<a4<a5<a6) {
                    if(termcheck(a1)==true&&termcheck(a2)==true&&termcheck(a3)==true&&termcheck(a4)==true&&termcheck(a5)==true&&termcheck(a6)==true) cout << "true";
                }
                else cout << "false";}
}

Grading criterion: Declaration of variable and taking input
Rating A: correctly declares the variable M and followed by another variable to input the subsequence
Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: C