Language: C++

#include<iostream>
#include<string>
#include<map>
int main(){std::map<string,int>m;string s,t,u;for(;cin>>s;s.length()>u.length()?u=s:u)++m[s]>m[t]?t=s:s;std::cout<<t<<" "<<u<<"\n";}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:21: error: 'string' was not declared in this scope
    4 | int main(){std::map<string,int>m;string s,t,u;for(;cin>>s;s.length()>u.length()?u=s:u)++m[s]>m[t]?t=s:s;std::cout<<t<<" "<<u<<"\n";}
      |                     ^~~~~~
a.cc:4:21: 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:4:31: error: template argument 1 is invalid
    4 | int main(){std::map<string,int>m;string s,t,u;for(;cin>>s;s.length()>u.length()?u=s:u)++m[s]>m[t]?t=s:s;std::cout<<t<<" "<<u<<"\n";}
      |                               ^
a.cc:4:31: error: template argument 3 is invalid
a.cc:4:31: error: template argument 4 is invalid
a.cc:4:40: error: expected ';' before 's'
    4 | int main(){std::map<string,int>m;string s,t,u;for(;cin>>s;s.length()>u.length()?u=s:u)++m[s]>m[t]?t=s:s;std::cout<<t<<" "<<u<<"\n";}
      |                                        ^~
      |                                        ;
a.cc:4:52: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    4 | int main(){std::map<string,int>m;string s,t,u;for(;cin>>s;s.length()>u.length()?u=s:u)++m[s]>m[t]?t=s:s;std::cout<<t<<" "<<u<<"\n";}
      |                                                    ^~~
      |                                                    std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:4:57: error: 's' was not declared in this scope
    4 | int main(){std::map<string,int>m;string s,t,u;for(;cin>>s;s.length()>u.length()?u=s:u)++m[s]>m[t]?t=s:s;std::cout<<t<<" "<<u<<"\n";}
      |                                                         ^
a.cc:4:70: error: 'u' was not declared in this scope
    4 | int main(){std::map<string,int>m;string s,t,u;for(;cin>>s;s.length()>u.length()?u=s:u)++m[s]>m[t]?t=s:s;std::cout<<t<<" "<<u<<"\n";}
      |                                                                      ^
a.cc:4:96: error: 't' was not declared in this scope
    4 | int main(){std::map<string,int>m;string s,t,u;for(;cin>>s;s.length()>u.length()?u=s:u)++m[s]>m[t]?t=s:s;std::cout<<t<<" "<<u<<"\n";}
      |                                                                                                ^
a.cc:4:116: error: 't' was not declared in this scope
    4 | int main(){std::map<string,int>m;string s,t,u;for(;cin>>s;s.length()>u.length()?u=s:u)++m[s]>m[t]?t=s:s;std::cout<<t<<" "<<u<<"\n";}
      |                                                                                                                    ^
a.cc:4:124: error: 'u' was not declared in this scope
    4 | int main(){std::map<string,int>m;string s,t,u;for(;cin>>s;s.length()>u.length()?u=s:u)++m[s]>m[t]?t=s:s;std::cout<<t<<" "<<u<<"\n";}
      |                                                                                                                            ^