11377 | 2024-08-29 12:56:06 | MCDave | Kvázi-Izogram | cpp17 | Compilation error |
#include <iostream>
#include <vector>
#include <string>
using namespace std;
int main()
{
int n, i, j, out;
int abc[26] = { };
int x = sizeof(abc);
string text;
cin >> n;
out = n;
getline(cin, text);
for (i = 0; i < n; i++)
{
getline(cin, text);
memset(abc, 0, x);
for (j = 0; j < text.length(); j++)
{
text[j] = tolower(text[j]);
if (int(text[j]) != 32)
{
abc[int(text[j])-97]++;
}
}
for (j = 0; j < 26; j++)
{
if (abc[j] > 2)
{
out--;
}
}
}
cout << out;
}
open /var/local/lib/isolate/417/box/a.out: no such file or directory
main.cpp: In function 'int main()':
main.cpp:21:9: error: 'memset' was not declared in this scope
21 | memset(abc, 0, x);
| ^~~~~~
main.cpp:3:1: note: 'memset' is defined in header '<cstring>'; did you forget to '#include <cstring>'?
2 | #include <vector>
+++ |+#include <cstring>
3 | #include <string>