| 20833 | 2026-01-09 17:50:19 | PappMatyas | Síkság (55) | cpp17 | Forditási hiba |
#include <iostream>
using namespace std;
float Power(float inp, int power)
{
float ans = 1;
for (int i = 0; i < power; i++)
{
ans *= inp;
}
return ans;
}
int main()
{
int n;
cin >> n;
float rtf = mathf::sqrt(5);
float phi = (rtf + 1) / 2;
cout << (Power(phi, n) - Power((1/phi), n))/rtf;
return 0;
}open /var/local/lib/isolate/417/box/a.out: no such file or directory
main.cpp: In function 'int main()':
main.cpp:19:21: error: 'mathf' has not been declared
19 | float rtf = mathf::sqrt(5);
| ^~~~~