Language: C++

#include<iostream>
2
#include<cstring>
3
#include <cmath>
4
#include <algorithm>
5
using namespace std;
6
​
7
int main(){
8
    int number = 0;
9
    cin >> number;
10
    char** input = new char*[number];
11
​
12
    for(int i = 0; i < number; i++){
13
        input[i] = new char[51];
14
        cin >> input[i];
15
    }
16
    char same[51] = {0};
17
    int count = 0;
18
    for(int i = 0; i < strlen(input[0]); i++){
19
        bool find = true;
20
        for(int j = 1; j < number; j++){
21
            char* ptr = NULL;
22
            ptr = strchr(input[j],input[0][i]);
23
            if(ptr== NULL){
24
                find = false;
25
            }
26
        }
27
        if(find){
28
            for(int j = 1; j < number; j++){
29
                char* ptr = NULL;
30
                ptr = strchr(input[j],input[0][i]);
31
                if(ptr != NULL){
32
                    *ptr = '*';
33
                }
34
            }
35
            same[count] = input[0][i];
36
            count ++;
37
        }
38
        
39
    }
40
    same[count] = '\0';
41
    sort(same,same+strlen(same));
42
    cout << same;
43
    return 0;
44
}

Compiler output:
a.cc:2:1: error: expected unqualified-id before numeric constant
    2 | 2
      | ^
In file included from a.cc:3:
/usr/include/c++/14/cstring:78:11: error: 'memchr' has not been declared in '::'
   78 |   using ::memchr;
      |           ^~~~~~
/usr/include/c++/14/cstring:79:11: error: 'memcmp' has not been declared in '::'
   79 |   using ::memcmp;
      |           ^~~~~~
/usr/include/c++/14/cstring:80:11: error: 'memcpy' has not been declared in '::'
   80 |   using ::memcpy;
      |           ^~~~~~
/usr/include/c++/14/cstring:81:11: error: 'memmove' has not been declared in '::'
   81 |   using ::memmove;
      |           ^~~~~~~
/usr/include/c++/14/cstring:82:11: error: 'memset' has not been declared in '::'
   82 |   using ::memset;
      |           ^~~~~~
/usr/include/c++/14/cstring:83:11: error: 'strcat' has not been declared in '::'
   83 |   using ::strcat;
      |           ^~~~~~
/usr/include/c++/14/cstring:84:11: error: 'strcmp' has not been declared in '::'
   84 |   using ::strcmp;
      |           ^~~~~~
/usr/include/c++/14/cstring:85:11: error: 'strcoll' has not been declared in '::'
   85 |   using ::strcoll;
      |           ^~~~~~~
/usr/include/c++/14/cstring:86:11: error: 'strcpy' has not been declared in '::'
   86 |   using ::strcpy;
      |           ^~~~~~
/usr/include/c++/14/cstring:87:11: error: 'strcspn' has not been declared in '::'
   87 |   using ::strcspn;
      |           ^~~~~~~
/usr/include/c++/14/cstring:88:11: error: 'strerror' has not been declared in '::'
   88 |   using ::strerror;
      |           ^~~~~~~~
/usr/include/c++/14/cstring:89:11: error: 'strlen' has not been declared in '::'
   89 |   using ::strlen;
      |           ^~~~~~
/usr/include/c++/14/cstring:90:11: error: 'strncat' has not been declared in '::'
   90 |   using ::strncat;
      |           ^~~~~~~
/usr/include/c++/14/cstring:91:11: error: 'strncmp' has not been declared in '::'
   91 |   using ::strncmp;
      |           ^~~~~~~
/usr/include/c++/14/cstring:92:11: error: 'strncpy' has not been declared in '::'
   92 |   using ::strncpy;
      |           ^~~~~~~
/usr/include/c++/14/cstring:93:11: error: 'strspn' has not been declared in '::'
   93 |   using ::strspn;
      |           ^~~~~~
/usr/include/c++/14/cstring:95:11: error: 'strtok' has not been declared in '::'
   95 |   using ::strtok;
      |           ^~~~~~
/usr/include/c++/14/cstring:97:11: error: 'strxfrm' has not been declared in '::'
   97 |   using ::strxfrm;
      |           ^~~~~~~
/usr/include/c++/14/cstring:98:11: error: 'strchr' has not been declared in '::'
   98 |   using ::strchr;
      |           ^~~~~~
/usr/include/c++/14/cstring:99:11: error: 'strpbrk' has not been declared in '::'
   99 |   using ::strpbrk;
      |           ^~~~~~~
/usr/include/c++/14/cstring:100:11: error: 'strrchr' has not been declared in '::'
  100 |   using ::strrchr;
      |           ^~~~~~~
/usr/include/c++/14/cstring:101:11: error: 'strstr' has not been declared in '::'
  101 |   using ::strstr;
      |           ^~~~~~
a.cc:4:1: error: expected unqualified-id before numeric constant
    4 | 3
      | ^
In file included from a.cc:5:
/usr/include/c++/14/cmath:89:11: error: 'acos' has not been declared in '::'
   89 |   using ::acos;
      |           ^~~~
/usr/include/c++/14/cmath:108:11: error: 'asin' has not been declared in '::'
  108 |   using ::asin;
      |           ^~~~
/usr/include/c++/14/cmath:127:11: error: 'atan' has not been declared in '::'
  127 |   using ::atan;
      |           ^~~~
/usr/include/c++/14/cmath:146:11: error: 'atan2' has not been declared in '::'
  146 |   using ::atan2;
      |           ^~~~~
/usr/include/c++/14/cmath:158:11: error: 'ceil' has not been declared in '::'
  158 |   using ::ceil;
      |           ^~~~
/usr/include/c++/14/cmath:177:11: error: 'cos' has not been declared in '::'
  177 |   using ::cos;
      |           ^~~
/usr/include/c++/14/cmath:196:11: error: 'cosh' has not been declared in '::'
  196 |   using ::cosh;
      |           ^~~~
/usr/include/c++/14/cmath:215:11: error: 'exp' has not been declared in '::'
  215 |   using ::exp;
      |           ^~~
/usr/include/c++/14/cmath:234:11: error: 'fabs' has not been declared in '::'
  234 |   using ::fabs;
      |           ^~~~
/usr/include/c++/14/cmath:253:11: error: 'floor' has not been declared in '::'
  253 |   using ::floor;
      |           ^~~~~
/usr/include/c++/14/cmath:272:11: error: 'fmod' has not been declared in '::'
  272 |   using ::fmod;
      |           ^~~~
/usr/include/c++/14/cmath:284:11: error: 'frexp' has not been declared in '::'
  284 |   using ::frexp;
      |           ^~~~~
/usr/include/c++/14/cmath:303:11: error: 'ldexp' has not been declared in '::'
  303 |   using ::ldexp;
      |           ^~~~~
/usr/include/c++/14/cmath:322:11: error: 'log' has not been declared in '::'
  322 |   using ::log;
      |           ^~~
/usr/include/c++/14/cmath:341:11: error: 'log10' has not been declared in '::'
  341 |   using ::log10;
      |           ^~~~~
/usr/include/c++/14/cmath:360:11: error: 'modf' has not been declared in '::'
  360 |   using ::modf;
      |           ^~~~
/usr/include/c++/14/cmath:372:11: error: 'pow' has not been declared in '::'
  372 |   using ::pow;
      |           ^~~
/usr/include/c++/14/cmath:400:11: error: 'sin' has not been declared in '::'
  400 |   using ::sin;
      |           ^~~
/usr/include/c++/14/cmath:419:11: error: 'sinh' has not been declared in '::'
  419 |   using ::sinh;
      |           ^~~~
/usr/include/c++/14/cmath:438:11: error: 'sqrt' has not been declared in '::'
  438 |   using ::sqrt;
      |           ^~~~
/usr/include/c++/14/cmath:457:11: error: 'tan' has not been declared in '::'
  457 |   using ::tan;
      |           ^~~
/usr/include/c++/14/cmath:476:11: error: 'tanh' has not been declared in '::'
  476 |   using ::tanh;
      |           ^~~~
/usr/include/c++/14/cmath:1820:11: error: 'acosf' has not been declared in '::'
 1820 |   using ::acosf;
      |           ^~~~~
/usr/include/c++/14/cmath:1823:11: error: 'acosl' has not been declared in '::'
 1823 |   using ::acosl;
      |           ^~~~~
/usr/include/c++/14/cmath:1827:11: error: 'asinf' has not been declared in '::'
 1827 |   using ::asinf;
      |           ^~~~~
/usr/include/c++/14/cmath:1830:11: error: 'asinl' has not been declared in '::'
 1830 |   using ::asinl;
      |           ^~~~~
/usr/include/c++/14/cmath:1834:11: error: 'atanf' has not been declared in '::'
 1834 |   using ::atanf;
      |           ^~~~~
/usr/include/c++/14/cmath:1837:11: error: 'atanl' has not been declared in '::'
 1837 |   using ::atanl;
      |           ^~~~~
/usr/include/c++/14/cmath:1841:11: error: 'atan2f' has not been declared in '::'
 1841 |   using ::atan2f;
      |           ^~~~~~
/usr/include/c++/14/cmath:1844:11: error: 'atan2l' has not been declared in '::'
 1844 |   using ::atan2l;
      |           ^~~~~~
/usr/include/c++/14/cmath:1848:11: error: 'ceilf' has not been declared in '::'
 1848 |   using ::ceilf;
      |           ^~~~~
/usr/include/c++/14/cmath:1851:11: error: 'ceill' has not been declared in '::'
 1851 |   using ::ceill;
      |           ^~~~~
/usr/include/c++/14/cmath:1855:11: error: 'cosf' has not been declared in '::'
 1855 |   using ::cosf;
      |           ^~~~
/usr/include/c++/14/cmath:1858:11: error: 'cosl' has not been declared in '::'
 1858 |   using ::cosl;
      |           ^~~~
/usr/include/c++/14/cmath:1862:11: error: 'coshf' has not been declared in '::'
 1862 |   using ::coshf;
      |           ^~~~~
/usr/include/c++/14/cmath:1865:11: error: 'coshl' has not been declared in '::'
 1865 |   using ::coshl;
      |           ^~~~~
/usr/include/c++/14/cmath:1869:11: error: 'expf' has not been declared in '::'
 1869 |   using ::expf;
      |           ^~~~
/usr/include/c++/14/cmath:1872:11: error: 'expl' has not been declared in '::'
 1872 |   using ::expl;
      |           ^~~~
/usr/include/c++/14/cmath:1876:11: error: 'fabsf' has not been declared in '::'
 1876 |   using ::fabsf;
      |           ^~~~~
/usr/include/c++/14/cmath:1879:11: error: 'fabsl' has not been declared in '::'
 1879 |   using ::fabsl;
      |           ^~~~~
/usr/include/c++/14/cmath:1883:11: error: 'floorf' has not been declared in '::'
 1883 |   using ::floorf;
      |           ^~~~~~
/usr/include/c++/14/cmath:1886:11: error: 'floorl' has not been declared in '::'
 1886 |   using ::floorl;
      |           ^~~~~~
/usr/include/c++/14/cmath:1890:11: error: 'fmodf' has not been declared in '::'
 1890 |   using ::fmodf;
      |           ^~~~~
/usr/include/c++/14/cmath:1893:11: error: 'fmodl' has not been declared in '::'
 1893 |   using ::fmodl;
      |           ^~~~~
/usr/include/c++/14/cmath:1897:11: error: 'frexpf' has not been declared in '::'
 1897 |   using ::frexpf;
      |           ^~~~~~
/usr/include/c++/14/cmath:1900:11: error: 'frexpl' has not been declared in '::'
 1900 |   using ::frexpl;
      |           ^~~~~~
/usr/include/c++/14/cmath:1904:11: error: 'ldexpf' has not been declared in '::'
 1904 |   using ::ldexpf;
      |           ^~~~~~
/usr/include/c++/14/cmath:1907:11: error: 'ldexpl' has not been declared in '::'
 1907 |   using ::ldexpl;
      |           ^~~~~~
/usr/include/c++/14/cmath:1911:11: error: 'logf' has not been declared in '::'
 1911 |   using ::logf;
      |           ^~~~
/usr/include/c++/14/cmath:1914:11: error: 'logl' has not been declared in '::'
 1914 |   using ::logl;
      |           ^~~~
/usr/include/c++/14/cmath:1918:11: error: 'log10f' has not been declared in '::'
 1918 |   using ::log10f;
      |           ^~~~~~
/usr/include/c++/14/cmath:1921:11: error: 'log10l' has not been declared in '::'
 1921 |   using ::log10l;
      |           ^~~~~~
/usr/include/c++/14/cmath:1925:11: error: 'modff' has not been declared in '::'
 1925 |   using ::modff;
      |           ^~~~~
/usr/include/c++/14/cmath:1928:11: error: 'modfl' has not been declared in '::'
 1928 |   using ::modfl;
      |           ^~~~~
/usr/include/c++/14/cmath:1932:11: error: 'powf' has not been declared in '::'
 1932 |   using ::powf;
      |           ^~~~
/usr/include/c++/14/cmath:1935:11: error: 'powl' has not bee