6574 | 2023-12-12 11:26:02 | batyu | Gergő és a sárkány | cpp17 | Compilation error |
// Gergo_es_a_Sarkany.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include <string>
int main()
{
int N, D;
std::cin >> N >> D;
int megoldasok[2] = { -1,-1 };
int temp = 0;
int szam = D;
int maradek = 0;
while (szam <= std::pow(10, N) && temp <= 1)
{
int tsz = szam;
szam += maradek;
maradek = szam;
if (szam >= std::pow(10, N - 1) && szam < std::pow(10, N))
megoldasok[temp++] = szam;
}
if (megoldasok[0] == -1 || megoldasok[1] == -1)
std::cout << "0 0";
else
std::cout << megoldasok[0] << " " << megoldasok[1];
}
exit status 1
main.cpp: In function 'int main()':
main.cpp:14:25: error: 'pow' is not a member of 'std'
14 | while (szam <= std::pow(10, N) && temp <= 1)
| ^~~
main.cpp:19:26: error: 'pow' is not a member of 'std'
19 | if (szam >= std::pow(10, N - 1) && szam < std::pow(10, N))
| ^~~
main.cpp:19:56: error: 'pow' is not a member of 'std'
19 | if (szam >= std::pow(10, N - 1) && szam < std::pow(10, N))
| ^~~
Exited with error status 1