Language: C++

#include<bits/stdc++.h>
using namespase std;
int main(){
	string s;
	int k;
	cin >>s;
	cin >>k;
	int i,j;
	int n=s.length();
	set<string>ss;
	for(i=0;i<n;i++){
		for(j=1;j<=k&&i+j<=n;j++){
			ss.insert(s.substr(i,j));
		}
	}
	priority_queue<string>dict;
	for(auto moji:ss){
		dict.push(moji);
	}
	for(i=1;i<k;i++)dict.pop();
	cout<<dict.top()<<endl;
}

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namespase'
    2 | using namespase std;
      |       ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:4:9: error: 'string' was not declared in this scope
    4 |         string s;
      |         ^~~~~~
a.cc:4:9: note: suggested alternatives:
In file included from /usr/include/c++/14/string:41,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:6:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |         cin >>s;
      |         ^~~
      |         std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:6:15: error: 's' was not declared in this scope
    6 |         cin >>s;
      |               ^
a.cc:10:9: error: 'set' was not declared in this scope
   10 |         set<string>ss;
      |         ^~~
a.cc:10:9: note: suggested alternatives:
In file included from /usr/include/c++/14/set:63,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:158:
/usr/include/c++/14/bits/stl_set.h:96:11: note:   'std::set'
   96 |     class set
      |           ^~~
/usr/include/c++/14/set:87:13: note:   'std::pmr::set'
   87 |       using set = std::set<_Key, _Cmp, polymorphic_allocator<_Key>>;
      |             ^~~
a.cc:10:20: error: 'ss' was not declared in this scope
   10 |         set<string>ss;
      |                    ^~
a.cc:16:9: error: 'priority_queue' was not declared in this scope; did you mean 'std::priority_queue'?
   16 |         priority_queue<string>dict;
      |         ^~~~~~~~~~~~~~
      |         std::priority_queue
In file included from /usr/include/c++/14/queue:66,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:157:
/usr/include/c++/14/bits/stl_queue.h:496:11: note: 'std::priority_queue' declared here
  496 |     class priority_queue
      |           ^~~~~~~~~~~~~~
a.cc:16:31: error: 'dict' was not declared in this scope
   16 |         priority_queue<string>dict;
      |                               ^~~~
a.cc:21:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   21 |         cout<<dict.top()<<endl;
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:21:27: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   21 |         cout<<dict.top()<<endl;
      |                           ^~~~
      |                           std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~