1771 | 2022-12-02 21:45:28 | kdb | Sakktábla (75 pont) | cpp11 | Forditási hiba |
#include <iostream>
using namespace std;
int main()
{
cin.tie(nullptr);
cout.tie(nullptr);
ios_base::sync_with_stdio(false);
int a, b;
cin >> a >> b;
if (b > a)
{
int q = a;
a = b;
b = q;
}
for (int i = 1; ; i++)
{
double i2 = i * i/2;
int c = ceil(i2), d = floor(i2);
if (a < c || b < d)
{
cout << i - 1 << endl;
break;
}
}
return 0;
}
/*
12 15
-5
845123 982031
1300
*/
exit status 1
main.cpp: In function 'int main()':
main.cpp:19:17: error: 'ceil' was not declared in this scope
19 | int c = ceil(i2), d = floor(i2);
| ^~~~
main.cpp:20:26: error: 'd' was not declared in this scope
20 | if (a < c || b < d)
| ^
Exited with error status 1