5418 | 2023-05-17 09:27:47 | TortelliniJr | Táblajáték | cpp17 | Forditási hiba |
#include <iostream>
#include <vector>
#include <array>
using namespace std;
int main()
{
int n, s, o, j;
cin >> n;
for (int i = 0; i < n; i++)
{
cin >> j;
switch (j)
{
case 0:
s++;
o *= 2, o--;
break;
case 1:
s++, o *= 2;
break;
case 2:
s--;
o = ceil(o / 2);
case 3:
o--;
case 4:
o++;
}
}
cout << s << endl;
cout << o << endl;
}
exit status 1
main.cpp: In function 'int main()':
main.cpp:24:29: error: 'ceil' was not declared in this scope
24 | o = ceil(o / 2);
| ^~~~
Exited with error status 1