Language: C++

#include<iostream>
#include<cstring>

int main(){
char Big[26]={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
char small[26]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
string str1;
char str2[2000];
CHAR str3[2000];
int len;
str str4="";

cin>>str1;
len=str1.length();

for(int i=1;i<=len;i++){
str2[i]=str1.substr(i,1);
}

for(int i=1;i<=len;i++){
for(int j=0;j<26;j++){
if(str2[i]==Big[j]){
str3[i]=small[j];
}
else if(str2[i]==small[j]){
str3[i]=Big[j];
}
else{
str3[i]=str2[i];
}
}
}

for(int i=1;i<=len;i++){
str4 += str3[i];
}

cout<<str4;

return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:1: error: 'string' was not declared in this scope
    7 | string str1;
      | ^~~~~~
a.cc:7:1: 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:9:1: error: 'CHAR' was not declared in this scope
    9 | CHAR str3[2000];
      | ^~~~
a.cc:11:1: error: 'str' was not declared in this scope; did you mean 'str2'?
   11 | str str4="";
      | ^~~
      | str2
a.cc:13:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   13 | cin>>str1;
      | ^~~
      | std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:13:6: error: 'str1' was not declared in this scope; did you mean 'str2'?
   13 | cin>>str1;
      |      ^~~~
      |      str2
a.cc:23:1: error: 'str3' was not declared in this scope; did you mean 'str2'?
   23 | str3[i]=small[j];
      | ^~~~
      | str2
a.cc:26:1: error: 'str3' was not declared in this scope; did you mean 'str2'?
   26 | str3[i]=Big[j];
      | ^~~~
      | str2
a.cc:29:1: error: 'str3' was not declared in this scope; did you mean 'str2'?
   29 | str3[i]=str2[i];
      | ^~~~
      | str2
a.cc:35:1: error: 'str4' was not declared in this scope; did you mean 'str2'?
   35 | str4 += str3[i];
      | ^~~~
      | str2
a.cc:35:9: error: 'str3' was not declared in this scope; did you mean 'str2'?
   35 | str4 += str3[i];
      |         ^~~~
      |         str2
a.cc:38:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   38 | cout<<str4;
      | ^~~~
      | std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:38:7: error: 'str4' was not declared in this scope; did you mean 'str2'?
   38 | cout<<str4;
      |       ^~~~
      |       str2