Code C++ nè.
PHP Code:
#include <iostream>
void Count(int& output, int a, int b, int step)
{
if (a + b == 2013)
output++;
else if (step < 2013 && a + b < 2013)
{
Count(output, a, a + b, step + 1);
Count(output, a + b, b, step + 1);
}
}
void main()
{
int output = 0;
for (int i = 1; i < 1000; i++)
Count(output, i, i + 1, 0);
std::cout<<output<<"\n";
system("pause");
}
[RIGHT][I][B]Nguồn: MathScope.ORG[/B][/I][/RIGHT]