Hello, I compiled the program and ran it using different inputs. I am getting the correct answers, but on submitting, it shows all the test inputs get failed. Can you help me figure out my error?
Please help me find the error
hi @astha119btcse21_7380491a239a3b9b
refer this
#include <bits/stdc++.h>
using namespace std;
long long int fib(long long int n)
{
if (n <= 1)
return n;
return fib(n - 1) + fib(n - 2);
}
int main()
{
int testCases;
cin >> testCases;
int k = 1;
while (testCases--)
{
int n;
cin >> n;
cout << "#" << k++ << " : " << fib(n+2) << endl;
}
return 0;
}
The solution that you sent is not readable