Language: C++

#include <iostream>                                                             #include <string>                                                                                                                                               using namespace std;
int main()                                                                      {                                                                                   const char groundtruth[] = "CODEFESTIVAL2016";                                                                                                                  string str;                                                                     cin >> str;                                                                                                                                                     int count = 0;                                                                  for (string::size_type i = 0; i < str.size(); ++i) {                                if (str[i] != groundtruth[i]) ++count;                                      }                                                                                                                                                               cout << count << endl;
    return 0;                                                                   }

Compiler output:
a.cc:1:81: warning: extra tokens at end of #include directive
    1 | #include <iostream>                                                             #include <string>                                                                                                                                               using namespace std;
      |                                                                                 ^
a.cc: In function 'int main()':
a.cc:2:325: error: 'string' was not declared in this scope
    2 | int main()                                                                      {                                                                                   const char groundtruth[] = "CODEFESTIVAL2016";                                                                                                                  string str;                                                                     cin >> str;                                                                                                                                                     int count = 0;                                                                  for (string::size_type i = 0; i < str.size(); ++i) {                                if (str[i] != groundtruth[i]) ++count;                                      }                                                                                                                                                               cout << count << endl;
      |                                                                                                                                                                                                                                                                                                                                     ^~~~~~
a.cc:2:325: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44:
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:2:405: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    2 | int main()                                                                      {                                                                                   const char groundtruth[] = "CODEFESTIVAL2016";                                                                                                                  string str;                                                                     cin >> str;                                                                                                                                                     int count = 0;                                                                  for (string::size_type i = 0; i < str.size(); ++i) {                                if (str[i] != groundtruth[i]) ++count;                                      }                                                                                                                                                               cout << count << endl;
      |                                                                                                                                                                                                                                                                                                                                                                                                                     ^~~
      |                                                                                                                                                                                                                                                                                                                                                                                                                     std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:2:412: error: 'str' was not declared in this scope; did you mean 'std'?
    2 | int main()                                                                      {                                                                                   const char groundtruth[] = "CODEFESTIVAL2016";                                                                                                                  string str;                                                                     cin >> str;                                                                                                                                                     int count = 0;                                                                  for (string::size_type i = 0; i < str.size(); ++i) {                                if (str[i] != groundtruth[i]) ++count;                                      }                                                                                                                                                               cout << count << endl;
      |                                                                                                                                                                                                                                                                                                                                                                                                                            ^~~
      |                                                                                                                                                                                                                                                                                                                                                                                                                            std
a.cc:2:650: error: 'string' is not a class, namespace, or enumeration
    2 | int main()                                                                      {                                                                                   const char groundtruth[] = "CODEFESTIVAL2016";                                                                                                                  string str;                                                                     cin >> str;                                                                                                                                                     int count = 0;                                                                  for (string::size_type i = 0; i < str.size(); ++i) {                                if (str[i] != groundtruth[i]) ++count;                                      }                                                                                                                                                               cout << count << endl;
      |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ^~~~~~
a.cc:2:675: error: 'i' was not declared in this scope
    2 | int main()                                                                      {                                                                                   const char groundtruth[] = "CODEFESTIVAL2016";                                                                                                                  string str;                                                                     cin >> str;                                                                                                                                                     int count = 0;                                                                  for (string::size_type i = 0; i < str.size(); ++i) {                                if (str[i] != groundtruth[i]) ++count;                                      }                                                                                                                                                               cout << count << endl;
      |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   ^
a.cc:2:965: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    2 | int main()                                                                      {