113782024-08-29 13:05:00MCDaveKvázi-Izogramcpp17Compilation 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;
    cin.ignore();

    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;
}
Compilation error
open /var/local/lib/isolate/423/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>