Untitled
raw download clone
TEXT
views 14
,
size 421 b
#include <fstream>

using namespace std;
ifstream fin("fiboverif1.in");
ofstream fout("fiboverif1.out");
int main()
{
    int n,h;
    fin >> n;
    for(int i=1;i<=n;i++)
        {fin >> h;
        int x=0,y=1,z=0;
        while(x+y<h)
        {
            z=x+y;
            x=y;
            y=z;
        }
        if(x+y==h)
            fout << h << " ";
        
      
    }

    return 0;
}
close fullscreen
Login or Register to edit or fork this paste. It's free.