1547 | 2022-11-23 12:47:46 | zsebi | Bimmbamm (30) | cpp11 | Compilation error |
#include <iostream>
#include <string>
using namespace std;
string s;
string a = "BIMM";
string b = "BAMM";
string c = "BUMM";
int n, ok, i;
int main()
{
cin >> n;
getline(cin, s);
ok = 0;
for (i = 1; i <= n; ++i)
{
cin >> s;
if (i % 3 == 0 && i % 5 == 0)
{
if (s[1] != c[1])
{
cout << i;
ok = 1;
break;
}
}
else if (i % 3 == 0)
{
if (s[1] != a[1])
{
cout << i;
ok = 1;
break;
}
}
else if (i % 5 == 0)
{
if (s[1] != b[1])
{
cout << i;
ok = 1;
break;
}
}
}
if (ok == 0)cout << "0";
return 0;
exit status 1
main.cpp: In function 'int main()':
main.cpp:53:14: error: expected '}' at end of input
53 | return 0;
| ^
main.cpp:11:1: note: to match this '{'
11 | {
| ^
Exited with error status 1