criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  string a;
  cin >> a;
  int x = a.at();

  cout << a.at(0) << x << a.at(x) << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:15: error: no matching function for call to 'std::__cxx11::basic_string<char>::at()'
    7 |   int x = a.at();
      |           ~~~~^~
In file included from /usr/include/c++/14/string:54,
                 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/basic_string.h:1287:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::const_reference std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::at(size_type) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; const_reference = const char&; size_type = long unsigned int]'
 1287 |       at(size_type __n) const
      |       ^~
/usr/include/c++/14/bits/basic_string.h:1287:7: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/basic_string.h:1309:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::reference std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::at(size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; reference = char&; size_type = long unsigned int]'
 1309 |       at(size_type __n)
      |       ^~
/usr/include/c++/14/bits/basic_string.h:1309:7: note:   candidate expects 1 argument, 0 provided
Language: C++

#include <bit/stdc++.h>
using namespace std;

int main(){
  string s;
  cin >> s;
  
  int N=s.length();
  cout << s[0] << N-2 << s[N-1] << endl;
}


Compiler output:
a.cc:1:10: fatal error: bit/stdc++.h: No such file or directory
    1 | #include <bit/stdc++.h>
      |          ^~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bit/stdc++>
using namespace std;

int main(){
  string s;
  cin >> s;
  
  int N=s.length();
  cout << s[0] << N-2 << s[N-1] << endl;
}

Compiler output:
a.cc:1:10: fatal error: bit/stdc++: No such file or directory
    1 | #include <bit/stdc++>
      |          ^~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  string s;
  cin >> s;
  int n = s.size;
  cout << s.at(0) << n - 2 << s.at(n) << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:13: error: cannot convert 'std::__cxx11::basic_string<char>::size' from type 'std::__cxx11::basic_string<char>::size_type (std::__cxx11::basic_string<char>::)() const noexcept' {aka 'long unsigned int (std::__cxx11::basic_string<char>::)() const noexcept'} to type 'int'
    7 |   int n = s.size;
      |             ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  string s;
  cin >> s;
  int n;
  n = s.size;
  cout << s.at(0) << n - 2 << s.at(n) << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: cannot convert 'std::__cxx11::basic_string<char>::size' from type 'std::__cxx11::basic_string<char>::size_type (std::__cxx11::basic_string<char>::)() const noexcept' {aka 'long unsigned int (std::__cxx11::basic_string<char>::)() const noexcept'} to type 'int'
    8 |   n = s.size;
      |         ^~~~
Language: C++

#include<iostream>
#include<cstring>
#include<string>
using namespace std;
const int maxn=1e6+1;
char s[maxn];
int main(){
	gets(s);
	cout<<s[0]<<strlen(s)-2<<s[strlen(s)-1]<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
    8 |         gets(s);
      |         ^~~~
      |         getw
Language: C++

#include <iostream>
using namespace std;

int main(){
  string s;
  cin >> s ;
  
  cout << s.at(0) << .size(s) << s.at(.size(s)) << endl;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:22: error: expected primary-expression before '.' token
    8 |   cout << s.at(0) << .size(s) << s.at(.size(s)) << endl;
      |                      ^
a.cc:8:39: error: expected primary-expression before '.' token
    8 |   cout << s.at(0) << .size(s) << s.at(.size(s)) << endl;
      |                                       ^
Language: C++

#include<iostream>
#include<string>

int main(){
  string s;
  int num=0;
  for(int i=1;i<s.size()-1;i++){
    num++;
  }
  
  cout << s.at(0) << num << s.at(s.size()-1) << endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'string' was not declared in this scope
    5 |   string s;
      |   ^~~~~~
a.cc:5:3: 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:7:17: error: 's' was not declared in this scope
    7 |   for(int i=1;i<s.size()-1;i++){
      |                 ^
a.cc:11:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   11 |   cout << s.at(0) << num << s.at(s.size()-1) << 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:11:11: error: 's' was not declared in this scope
   11 |   cout << s.at(0) << num << s.at(s.size()-1) << endl;
      |           ^
a.cc:11:49: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   11 |   cout << s.at(0) << num << s.at(s.size()-1) << endl;
      |                                                 ^~~~
      |                                                 std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:11:54: error: expected '}' at end of input
   11 |   cout << s.at(0) << num << s.at(s.size()-1) << endl;
      |                                                      ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(void){
  string s;
  scanf("%s",s);
  printf("%c",s[0]);
  printf("%d",s.size-2);
  printf("%c",s[100]);

}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:17: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
    7 |   printf("%d",s.size-2);
      |               ~~^~~~
      |                     ()
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(void){
  string s;
  scanf("%s",s);
  printf("%c",s[0]);
  printf("%d",s.length-2);
  printf("%c",s[100]);

}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:17: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
    7 |   printf("%d",s.length-2);
      |               ~~^~~~~~
      |                       ()
Language: C++

#include <iostream>
#include <string>
using namespace std;

int main() {
    string s;
    cin >> s;
    int size = s.length();
  	string hajime = s[0];
  	string owari = s[size - 1];
    cout << hajime << size - 2 << owari << endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:9:28: error: conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
    9 |         string hajime = s[0];
      |                            ^
a.cc:10:34: error: conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
   10 |         string owari = s[size - 1];
      |                                  ^
Language: C++

#include <iostream>
#include <string>
using namespace std;

int main() {
    string s;
    cin >> s;
    int size = s.size();
  	int hajime = s[0];
  	int owari = s[size - 1]
    cout << hajime << size - 2 << owari << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: expected ',' or ';' before 'cout'
   11 |     cout << hajime << size - 2 << owari << endl;
      |     ^~~~
Language: C++

#include <iostream>
#include <string>
using namespace std;

int main() {
    string s;
    cin >> s;
    int size = s.size();
  	int hajime = s[0];
  	int owari = s[size - 1]
    cout << hajime + owari << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: expected ',' or ';' before 'cout'
   11 |     cout << hajime + owari << endl;
      |     ^~~~
Language: C++

#include <iostream>
#include <string>
using namespace std;

int main(){
	string s;
	char first, end;
	int p;

	cin >> s;
	p = strlen(s);
	first = s[0];
	end = s[p - 1];
	cout << first << p-2 << end << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:13: error: 'strlen' was not declared in this scope
   11 |         p = strlen(s);
      |             ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | #include <string>
Language: C++

#include <iostream>
#include <string>
#include <sstream>
using namespace std;

int main(){
	string s;
	ostringstream result;
	char first, end;
	int p;

	cin >> s;
	p = strlen(s);
	first = s[0];
	end = s[p - 1];
	result << first << p-2 << end;
	cout << result.str() << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:13: error: 'strlen' was not declared in this scope
   13 |         p = strlen(s);
      |             ^~~~~~
a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <sstream>
  +++ |+#include <cstring>
    4 | using namespace std;
Language: C++

#include <iostream>
#include <string>
#include <sstream>
using namespace std;

int main(){
	string s;
	stringstream result;
	char first, end;
	int p;

	cin >> s;
	p = strlen(s);
	first = s[0];
	end = s[p - 1];
	result << first << p-2 << end;
	cout << result.str() << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:13: error: 'strlen' was not declared in this scope
   13 |         p = strlen(s);
      |             ^~~~~~
a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <sstream>
  +++ |+#include <cstring>
    4 | using namespace std;
Language: C

#include <stdio.h>
int main(){

  char s[105];
  
  scanf("%s", s);
  int n = 0;
  for (n=0, s[n] != '\0', ++n);
  
  printf("%c%d%c", s[0], n, s[n]);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:30: error: expected ';' before ')' token
    8 |   for (n=0, s[n] != '\0', ++n);
      |                              ^
      |                              ;
main.c:8:30: error: expected expression before ')' token
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
 
  string S,s ;
  int C;
  
  cin>>S;
  C= S.size();
  
  s=S[0]&c-2&S[C];
  

}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:10: error: 'c' was not declared in this scope
   12 |   s=S[0]&c-2&S[C];
      |          ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
    char s[10001];
    gets(s);
    cout<<s[0]<<strlen(s)-2<<s[strlen(s)-1]<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
    6 |     gets(s);
      |     ^~~~
      |     getw
Language: C++

#include <iostream>
#include <string>
using namespace std;

int main(){
  string s;
  cin >> s;
  int size = s.size() - 2 ;
  string size_string = size;
  string result = s[0] + size_string + s[size-1];
  cout << result << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:24: error: conversion from 'int' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
    9 |   string size_string = size;
      |                        ^~~~
Language: Java

import java.util.Scanner;

public class Maiin {
	public static void main(String[] args){
		
		Scanner scan = new Scanner(System.in);
		
		String S = scan.next();
		
		String a =S.substring(0, 1)+Integer.toString(S.substring(1, S.length()-1).length())
		+S.substring(S.length()-1, S.length());
		
		System.out.println(a);
		
	}
}

Compiler output:
Main.java:3: error: class Maiin is public, should be declared in a file named Maiin.java
public class Maiin {
       ^
1 error
Language: C++

#include<iostream>
#include <string>
using namespace std;

int main() {
  string s;
  cin>>s;
  int size = s.size();
  cout<<str[0]<<size-1<< str[size-1] <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'str' was not declared in this scope; did you mean 'std'?
    9 |   cout<<str[0]<<size-1<< str[size-1] <<endl;
      |         ^~~
      |         std
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main() {
    string s;
    cin >> s;
    int length = s.length;

    cout << (s[0] +  to_string(length - 2)  + s[length-2]) << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:20: error: cannot convert 'std::__cxx11::basic_string<char>::length' from type 'std::__cxx11::basic_string<char>::size_type (std::__cxx11::basic_string<char>::)() const noexcept' {aka 'long unsigned int (std::__cxx11::basic_string<char>::)() const noexcept'} to type 'int'
    7 |     int length = s.length;
      |                    ^~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main() {
    string s;
    cin >> s;
    int length = s.size;
    cout << (s[0] +  to_string(length - 2)  + s[length-1]) << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:20: error: cannot convert 'std::__cxx11::basic_string<char>::size' from type 'std::__cxx11::basic_string<char>::size_type (std::__cxx11::basic_string<char>::)() const noexcept' {aka 'long unsigned int (std::__cxx11::basic_string<char>::)() const noexcept'} to type 'int'
    7 |     int length = s.size;
      |                    ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main() {
    string s;
    cin >> s;
    int length = s.length;
    cout << (s[0] +  to_string(length - 2)  + s[length-1]) << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:20: error: cannot convert 'std::__cxx11::basic_string<char>::length' from type 'std::__cxx11::basic_string<char>::size_type (std::__cxx11::basic_string<char>::)() const noexcept' {aka 'long unsigned int (std::__cxx11::basic_string<char>::)() const noexcept'} to type 'int'
    7 |     int length = s.length;
      |                    ^~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main() {
    string s;
    cin >> s;
    int length = s.length;
    cout << s[0] +  to_string(length - 2)  + s[length-1];

}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:20: error: cannot convert 'std::__cxx11::basic_string<char>::length' from type 'std::__cxx11::basic_string<char>::size_type (std::__cxx11::basic_string<char>::)() const noexcept' {aka 'long unsigned int (std::__cxx11::basic_string<char>::)() const noexcept'} to type 'int'
    7 |     int length = s.length;
      |                    ^~~~~~
Language: C++

#include<iostream>
#include<string>

using namespace std;
int main(){
string S;
  cout<<S.front()<<S.length<<S.end();
}



Compiler output:
a.cc: In function 'int main()':
a.cc:7:18: error: invalid use of non-static member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
    7 |   cout<<S.front()<<S.length<<S.end();
      |   ~~~~~~~~~~~~~~~^~~~~~~~~~
In file included from /usr/include/c++/14/string:54,
                 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,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:1083:7: note: declared here
 1083 |       length() const _GLIBCXX_NOEXCEPT
      |       ^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
typedef long long ll;
int main()	{
  string s;
  cin>>s;
  int sum=s.size()-2;
  cout<<s[0]<<sum<<s{sum+1]<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:21: error: expected ';' before '{' token
   11 |   cout<<s[0]<<sum<<s{sum+1]<<endl;
      |                     ^
      |                     ;
a.cc:12:2: error: expected '}' at end of input
   12 | }
      |  ^
a.cc:7:17: note: to match this '{'
    7 | int main()      {
      |                 ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define rep2(i, a, n) for(ll i = a; i < (ll)(n); i++)
#define memi cout << endl
#define kono(n) cout << fixed << setprecision(n)
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define hina cout << ' '
#define in(n) cin >> n
#define in2(n, m) cin >> n >> m
#define in3(n, m, l) cin >> n >> m >> l
#define out(n) cout << n
const ll mei = (ll)1e9 + 7;

int main(){
  string s;
  in(s);
  out(s[0]);
  out(s.size() - 2);
  out(s[n - 1]);
  memi;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:9: error: 'n' was not declared in this scope
   22 |   out(s[n - 1]);
      |         ^
a.cc:14:24: note: in definition of macro 'out'
   14 | #define out(n) cout << n
      |                        ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
    string s;
    cin>>s;
    int len=s.size;
    cout<<s[0]<<len-2<<s[len-1];
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:15: error: cannot convert 'std::__cxx11::basic_string<char>::size' from type 'std::__cxx11::basic_string<char>::size_type (std::__cxx11::basic_string<char>::)() const noexcept' {aka 'long unsigned int (std::__cxx11::basic_string<char>::)() const noexcept'} to type 'int'
    7 |     int len=s.size;
      |               ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
    string s;
    cin>>s;
    int len=s.size;
    cout<<s[0]<<len-2<<s[len-1];
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:15: error: cannot convert 'std::__cxx11::basic_string<char>::size' from type 'std::__cxx11::basic_string<char>::size_type (std::__cxx11::basic_string<char>::)() const noexcept' {aka 'long unsigned int (std::__cxx11::basic_string<char>::)() const noexcept'} to type 'int'
    7 |     int len=s.size;
      |               ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main(){
  string S
  cin >> S;
  cout << S.at(0);
  cout << S.size()-2;
  cout << S.at(S.size()-1) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: expected initializer before 'cin'
    6 |   cin >> S;
      |   ^~~
a.cc:7:11: error: 'S' was not declared in this scope
    7 |   cout << S.at(0);
      |           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
    string s;
    cin >> s;
    cout << s.at(0) << "s.size()-2" << s.at(s.size-1);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:47: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
    7 |     cout << s.at(0) << "s.size()-2" << s.at(s.size-1);
      |                                             ~~^~~~
      |                                                   ()
Language: C++

    #include <bits/stdc++.h>
    using namespace std;
    #define rep(i, n) for (int i = 0; i < (int)(n); i++)
     
    int main() {
      string t;
      cin >> t;
      cout << t[0] + t.size() - 2 + t[t.size] << endl;
      
	}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:38: error: invalid use of non-static member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
    8 |       cout << t[0] + t.size() - 2 + t[t.size] << endl;
      |                                      ^
In file included from /usr/include/c++/14/string:54,
                 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/basic_string.h:1076:7: note: declared here
 1076 |       size() const _GLIBCXX_NOEXCEPT
      |       ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
string s;
int main()
{
    cin>>s;
    cout<<s[0]<<s.size-2<<s[s.size()-1];
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:19: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
    7 |     cout<<s[0]<<s.size-2<<s[s.size()-1];
      |                 ~~^~~~
      |                       ()
Language: C++

#include <bits/stdc++.h>
using namespace std;

#define lli long long int
#define LLI(n) lli n; cin >> n;
#define STR(n) string n; cin >> s;
#define Sort(n) sort(n.begin(), n.end());
#define Reve(n) reverse(n.begin(), n.end());
#define yes cout << "Yes" << endl;
#define no cout << "No" << endl;
#define C45(n) (n + 1) / 2
#define OUT(n) cout << n << endl;
#define SRC(n, c)for (lli i = 0;i < s.size(); i++) { if (s.at(i) == c) { n++; } };

//素数
bool IsPrime(lli num)
{
  if (num < 2) return false;
  else if (num == 2) return true;
  else if (num % 2 == 0) return false;
  long double sqrtNum = sqrt(num);
  for (lli i = 3; i <= sqrtNum; i += 2)
  {
    if (num % i == 0)return false;
  }
  return true;
}
//各桁の和
lli Sum(lli n)
{
  lli sum=0;
  if (n<0) return 0;
  while (n>0)
  {
    sum += n%10;
    n /= 10;
  }
  return sum;
}

int main(void)
{
  ios::sync_with_stdio(false);
  STR(s);
  OUT(s.begin+"18"+s.end);
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:45:14: error: invalid operands of types '<unresolved overloaded function type>' and 'const char [3]' to binary 'operator+'
   45 |   OUT(s.begin+"18"+s.end);
      |       ~~~~~~~^~~~~
      |         |     |
      |         |     const char [3]
      |         <unresolved overloaded function type>
a.cc:12:24: note: in definition of macro 'OUT'
   12 | #define OUT(n) cout << n << endl;
      |                        ^
Language: C++

#include<iostream>
#include<string>

int main(){
  std::string s;
  std::cin >> s;
  int n = s.size() - 2;
  std::cout << s[0] << n << s[s.size() - 1] ;

Compiler output:
a.cc: In function 'int main()':
a.cc:8:46: error: expected '}' at end of input
    8 |   std::cout << s[0] << n << s[s.size() - 1] ;
      |                                              ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: Java

import java.util.Scanner;
public class Main{
  public static void main(String[] args){
	Scanner sc = new Scanner(System.in);
    String x = sc.next();
    String y = Integer.toString(x.length() - 2);
    System.out.print(x.charAt(0));
    System.out.print(y);
    System.out.println(x.charAt(x.length() -1);

  }
}


Compiler output:
Main.java:9: error: ')' or ',' expected
    System.out.println(x.charAt(x.length() -1);
                                              ^
1 error
Language: Java

import java.util.Scanner;
public class Main{
  public static void main(String[] args){
	Scanner sc = new Scanner(System.in);
    String x = sc.next();
    String y = Integer.toString(x.lentgh() - 2);
    System.out.print(x.charAt(0));
    System.out.print(y);
    System.out.println(x.charAt(x.length -1));

  }
}


Compiler output:
Main.java:6: error: cannot find symbol
    String y = Integer.toString(x.lentgh() - 2);
                                 ^
  symbol:   method lentgh()
  location: variable x of type String
Main.java:9: error: cannot find symbol
    System.out.println(x.charAt(x.length -1));
                                 ^
  symbol:   variable length
  location: variable x of type String
2 errors
Language: Java

import java.util.Scanner;
public class Main{
  public static void main(String[] args){
	Scanner sc = new Scanner(System.in);
    String x = sc.next();
    String y = Integer.toString(x.lentgh() - 2);
    System.out.print(x.charAt(0));
    System.out.print(y);
    System.out.println(x.charAt(x.length -1);

  }
}

Compiler output:
Main.java:9: error: ')' or ',' expected
    System.out.println(x.charAt(x.length -1);
                                            ^
1 error
Language: Java

import java.util.Scanner;
public class Main{
  public static void main(String[] args){
	Scanner sc = new Scanner(System.in);
    String x = sc.next();
    //文字数を検索→先頭と最後尾以外を置換
    String y = x.substring(1, x.length() - 1);
    String z = (x.length() -2).toString();
    System.out.println(x.replace(y, z));
  }
}

Compiler output:
Main.java:8: error: int cannot be dereferenced
    String z = (x.length() -2).toString();
                              ^
1 error
Language: Java

import java.util.Scanner;
public class Main{
  public static void main(String[] args){
	Scanner sc = new Scanner(System.in);
    String x = sc.next();
    //文字数を検索→先頭と最後尾以外を置換
    String y = x.substring(1, x.length - 1);
    String z = (x.length -2).toString();
    System.out.println(x.replace(y, z));
  }
}

Compiler output:
Main.java:7: error: cannot find symbol
    String y = x.substring(1, x.length - 1);
                               ^
  symbol:   variable length
  location: variable x of type String
Main.java:8: error: cannot find symbol
    String z = (x.length -2).toString();
                 ^
  symbol:   variable length
  location: variable x of type String
2 errors
Language: Java

import java.util.Scanner;
public class Main{
  public static void main(String[] args){
	Scanner sc = new Scanner(System.in);
    String x = sc.next();
    //文字数を検索→先頭と最後尾以外を置換
    String y = x.substring(1, x.length - 1);
    String z = (x.length -2).toString();
    System.out.println(x.replace(y, z);
  }
}

Compiler output:
Main.java:9: error: ')' or ',' expected
    System.out.println(x.replace(y, z);
                                      ^
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {

  string s;

  cin >> s;

  cout << s[0] + (s.length - 2) + s[s.length - 1] << endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:21: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   10 |   cout << s[0] + (s.length - 2) + s[s.length - 1] << endl;
      |                   ~~^~~~~~
      |                           ()
a.cc:10:39: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   10 |   cout << s[0] + (s.length - 2) + s[s.length - 1] << endl;
      |                                     ~~^~~~~~
      |                                             ()
Language: C++

#include <iostream>
#include<string>
using namespace std;
int main()
{
	int n;
	string S;
	cin >> S;
	n = S.size;
	cout << S[0] << n<<S[n];
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:15: error: cannot convert 'std::__cxx11::basic_string<char>::size' from type 'std::__cxx11::basic_string<char>::size_type (std::__cxx11::basic_string<char>::)() const noexcept' {aka 'long unsigned int (std::__cxx11::basic_string<char>::)() const noexcept'} to type 'int'
    9 |         n = S.size;
      |               ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  	string s; cin>>s;
  	int n=s.size()-1;
  cout<<s.start()<<n<<s.end()<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:11: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'start'
    6 |   cout<<s.start()<<n<<s.end()<<endl;
      |           ^~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  	string s; cin>>s;
  	n=s.size()-1;
  cout<<s.start()<<n<<s.end()<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'n' was not declared in this scope
    5 |         n=s.size()-1;
      |         ^
a.cc:6:11: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'start'
    6 |   cout<<s.start()<<n<<s.end()<<endl;
      |           ^~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
char s[110],ans;
int main(){
	cin>>s;
	int len=strlen(s);
	for(int i=1;i<strlen-1;i++) ans++;
	cout<<s[0]<<ans<<s[len-1];
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:29: warning: pointer to a function used in arithmetic [-Wpointer-arith]
    7 |         for(int i=1;i<strlen-1;i++) ans++;
      |                       ~~~~~~^~
a.cc:7:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    7 |         for(int i=1;i<strlen-1;i++) ans++;
      |                     ~^~~~~~~~~
Language: C++

#include <bits/stdc++.h> 
using namespace std;
#define rep(i, N) for(int i=0; i<N; i++)
typedef long long ll;
#define dump(x) cerr<<#x<<"="<<x<<endl

int main() {
    string s; cin >> s;

    cout << s.at(0) << s.size()-2 << s.at(s.size()-1) << endl;


Compiler output:
a.cc: In function 'int main()':
a.cc:10:63: error: expected '}' at end of input
   10 |     cout << s.at(0) << s.size()-2 << s.at(s.size()-1) << endl;
      |                                                               ^
a.cc:7:12: note: to match this '{'
    7 | int main() {
      |            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
typedef long double ld;
const int inf=1e9+7;
const ll longinf=1LL<<60;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
#define F first
#define S second
 
const int mx=200010;
const ll mod=1e9+7;


int main(){  
  string s;
  cin >> s;
  int sz=s.size();
  cout　<< s[0] << sz-2 << s[sz-1] << endl;
  return 0;
}

Compiler output:
a.cc:21:3: error: extended character 　 is not valid in an identifier
   21 |   cout　<< s[0] << sz-2 << s[sz-1] << endl;
      |   ^
a.cc: In function 'int main()':
a.cc:21:3: error: 'cout\U00003000' was not declared in this scope
   21 |   cout　<< s[0] << sz-2 << s[sz-1] << endl;
      |   ^~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
string s;
cin>>n;
int x=s.size();
cout<<s[0]<<x-2<<s[x-1];}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:6: error: 'n' was not declared in this scope
    5 | cin>>n;
      |      ^
Language: C++

#include <iostream>
#include <string>
using namespace std;

int main() {
    string s;
    cin >> s;
    string size = s.size();
	string out;
  	out[1] = s[1];
  	out[2] = size;
  	out[3] = s[3];
    cout << out << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:25: error: conversion from 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
    8 |     string size = s.size();
      |                   ~~~~~~^~
a.cc:11:18: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} in assignment
   11 |         out[2] = size;
      |                  ^~~~
      |                  |
      |                  std::string {aka std::__cxx11::basic_string<char>}
Language: C++

#include<iostream>
#include<cstring>
using namespace std;
char s[10001];
int main()
{
    gets(s);
    cout<<s[0]<<strlen(s)-2<<s[strlen(s)-1]<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
    7 |     gets(s);
      |     ^~~~
      |     getw
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
	char s[105];
	scanf("%d",s);
	int sum=0;
	while(a[sum])
	{
		sum++;
	};
	printf("%c%d%c",s[0],sum-2,s[sum-1]);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:15: error: 'a' was not declared in this scope
    8 |         while(a[sum])
      |               ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
	char s[105];
	scanf("%d",s);
	int sum=0;
	while(a[sum])
	{
		sum++;
	}
	printf("%c%d%c",s[0],sum-2,s[sum-1]);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:15: error: 'a' was not declared in this scope
    8 |         while(a[sum])
      |               ^
Language: C++

#include<bits/stdc++.h>
using namespace std; 
int main()
{
  char a[100]; 
  cin>>a; 
  int len=a.length();
  
  cout<<a[0]<<len-2<<a[len]; 
  
  return 0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:13: error: request for member 'length' in 'a', which is of non-class type 'char [100]'
    7 |   int len=a.length();
      |             ^~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  int a,i;
  char s[i];
  cin>>s;
  a=s.length();
  cout<<s[0]<<a-2<<s[a-1]<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:7: error: request for member 'length' in 's', which is of non-class type 'char [i]'
    8 |   a=s.length();
      |       ^~~~~~
Language: C++

#include <iostream>
#include <string>
using namespace std;

int main(){
 string s;
 cin >> s;
 int x = s.size();
 cout << s.at(0);
 cout << x-2;
 cout << s.at(y-1) << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:15: error: 'y' was not declared in this scope
   11 |  cout << s.at(y-1) << endl;
      |               ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
string s;
int main()
{
  cin>>s;
  int ans=s.size()-3;
 cout<<s[0]<<ans<<s[s.size()-1];
   return;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:4: error: return-statement with no value, in function returning 'int' [-fpermissive]
    9 |    return;
      |    ^~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
 	ios_base::sync_with_stdio(false);
	cin.tie(0);
 	string s;
 	cin>>s;
 	cout<<s[0]<<s.size()-2<<s[n-1];
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:35: error: 'n' was not declared in this scope
    9 |         cout<<s[0]<<s.size()-2<<s[n-1];
      |                                   ^
Language: C++

#!/bin/bash

read s
echo ${s:0:1}$((${#s}-2))${s:$((${#s}-1)):$((${#s}-1))}
exit 0

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #!
    1 | #!/bin/bash
      |  ^
a.cc:4:19: error: stray '#' in program
    4 | echo ${s:0:1}$((${#s}-2))${s:$((${#s}-1)):$((${#s}-1))}
      |                   ^
a.cc:4:35: error: stray '#' in program
    4 | echo ${s:0:1}$((${#s}-2))${s:$((${#s}-1)):$((${#s}-1))}
      |                                   ^
a.cc:4:48: error: stray '#' in program
    4 | echo ${s:0:1}$((${#s}-2))${s:$((${#s}-1)):$((${#s}-1))}
      |                                                ^
a.cc:3:1: error: 'read' does not name a type
    3 | read s
      | ^~~~
a.cc:4:15: error: expected constructor, destructor, or type conversion before '(' token
    4 | echo ${s:0:1}$((${#s}-2))${s:$((${#s}-1)):$((${#s}-1))}
      |               ^
a.cc:4:22: error: expected unqualified-id before '-' token
    4 | echo ${s:0:1}$((${#s}-2))${s:$((${#s}-1)):$((${#s}-1))}
      |                      ^
a.cc:5:1: error: 'exit' does not name a type
    5 | exit 0
      | ^~~~
a.cc:1:1: note: 'exit' is defined in header '<cstdlib>'; this is probably fixable by adding '#include <cstdlib>'
  +++ |+#include <cstdlib>
    1 | #!/bin/bash
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main() {
	string s;
	int len=s.size;
	cout<<s[0]<<" "<<len-2<<" "<<s[len];
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:19: error: cannot convert 'std::__cxx11::basic_string<char>::size' from type 'std::__cxx11::basic_string<char>::size_type (std::__cxx11::basic_string<char>::)() const noexcept' {aka 'long unsigned int (std::__cxx11::basic_string<char>::)() const noexcept'} to type 'int'
    5 |         int len=s.size;
      |                   ^~~~
Language: C++

#include<cstring>
#include<cstdio>
using namespace std;
char s[10000];
int main()
{
    gets(s);
    printf("%c%d%c"，s[0],strlen(s)-2,s[strlen(s)-1]);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
    7 |     gets(s);
      |     ^~~~
      |     getw
a.cc:8:12: error: unable to find string literal operator 'operator""\U0000ff0cs' with 'const char [7]', 'long unsigned int' arguments
    8 |     printf("%c%d%c"，s[0],strlen(s)-2,s[strlen(s)-1]);
      |            ^~~~~~~~~~~
Language: C++

# Problem  https://atcoder.jp/contests/abc069/tasks/abc069_b
# Python 3rd Try


def solver(inputStr) :
    top =  inputStr[0]
    middle = len(inputStr)-2
    endChar = inputStr[-1]
    return top,middle,endChar


if __name__=="__main__" :
    answer1=''
    answer2=0
    answer3=''
    S = input()
    answer1,answer2,answer3= solver(S)
    print(answer1,answer2,answer3,sep='')





Compiler output:
a.cc:1:3: error: invalid preprocessing directive #Problem
    1 | # Problem  https://atcoder.jp/contests/abc069/tasks/abc069_b
      |   ^~~~~~~
a.cc:2:3: error: invalid preprocessing directive #Python
    2 | # Python 3rd Try
      |   ^~~~~~
a.cc:13:13: error: empty character constant
   13 |     answer1=''
      |             ^~
a.cc:15:13: error: empty character constant
   15 |     answer3=''
      |             ^~
a.cc:18:39: error: empty character constant
   18 |     print(answer1,answer2,answer3,sep='')
      |                                       ^~
a.cc:5:1: error: 'def' does not name a type
    5 | def solver(inputStr) :
      | ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  string S;
  cin >> S;
  cout << S[0] << S.size() - 2 << S[S.size.() - 1] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:39: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
    6 |   cout << S[0] << S.size() - 2 << S[S.size.() - 1] << endl;
      |                                     ~~^~~~
      |                                           ()
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  string s;
  cin>>s;
  cout<<s[0]<<s.size()-2<<s[s.size-1]<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:31: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
    6 |   cout<<s[0]<<s.size()-2<<s[s.size-1]<<endl;
      |                             ~~^~~~
      |                                   ()
Language: C++

#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
char a[120];
int main()
{
    scanf("%s",a);
    printf("%c%d%c\n",a[0],strlen(a)-2,a[strlen(a)-1a]);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:52: error: unable to find numeric literal operator 'operator""a'
    9 |     printf("%c%d%c\n",a[0],strlen(a)-2,a[strlen(a)-1a]);
      |                                                    ^~
Language: C++

#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
char a[120];
int main()
{
    scanf("%s",a);
    printf("%c%d%c",a[0],strlen(a)-2,a[strlen(a)-1a]);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:50: error: unable to find numeric literal operator 'operator""a'
    9 |     printf("%c%d%c",a[0],strlen(a)-2,a[strlen(a)-1a]);
      |                                                  ^~
Language: C++

#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
int main(){
	char a[1010];
	int x;
	cin>>a;
	cout<<a[0];
	x=strlen(a);
	x=x-2;
	cout<<x;
	cout<<a[x+1];
	cout<<endl;3
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:21: error: expected ';' before '}' token
   14 |         cout<<endl;3
      |                     ^
      |                     ;
   15 | }
      | ~
Language: C++

s=input();l=s[1:-1]
print(s[0]+str(len(l))+s[-1])

Compiler output:
a.cc:1:1: error: 's' does not name a type
    1 | s=input();l=s[1:-1]
      | ^
a.cc:1:11: error: 'l' does not name a type
    1 | s=input();l=s[1:-1]
      |           ^
Language: C++

#include <bits/stdc++.h>
#include <string>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
using namespace std;

int my_abs(int num){
   if (num > 0)
      return num;
   else
      return -num;
}

int main(){
    string S;
    cin >> S;
    cout << S.at(0);
    cout << S.size()-2;
    cout << S.at(S.size-1);
    cout << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:20: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   20 |     cout << S.at(S.size-1);
      |                  ~~^~~~
      |                        ()
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  string s;
  cin >>s;
  int n=string.size();
  cout << string.at(0) << n-2 << string.at(n-1);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:15: error: expected primary-expression before '.' token
    7 |   int n=string.size();
      |               ^
a.cc:8:17: error: expected primary-expression before '.' token
    8 |   cout << string.at(0) << n-2 << string.at(n-1);
      |                 ^
a.cc:8:40: error: expected primary-expression before '.' token
    8 |   cout << string.at(0) << n-2 << string.at(n-1);
      |                                        ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  string s;
  cin >>s;
  int n=string.size();
  cout << string.at(0) << n-2 << string.at(n-1);
  
 
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:15: error: expected primary-expression before '.' token
    7 |   int n=string.size();
      |               ^
a.cc:8:17: error: expected primary-expression before '.' token
    8 |   cout << string.at(0) << n-2 << string.at(n-1);
      |                 ^
a.cc:8:40: error: expected primary-expression before '.' token
    8 |   cout << string.at(0) << n-2 << string.at(n-1);
      |                                        ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  string s;
  cin >>s;
  int n=string.size();
  cout << string.at(0) << n-2 << string.at(n-1);
  
 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:15: error: expected primary-expression before '.' token
    7 |   int n=string.size();
      |               ^
a.cc:8:17: error: expected primary-expression before '.' token
    8 |   cout << string.at(0) << n-2 << string.at(n-1);
      |                 ^
a.cc:8:40: error: expected primary-expression before '.' token
    8 |   cout << string.at(0) << n-2 << string.at(n-1);
      |                                        ^
Language: C++

#include<bits/stdc++.h>
string a;
using namespace std;
int main(){
    gets(a);
    cout<<a[0]<<a.size()-2<<a[a.size()-1];
    return 0;
}

Compiler output:
a.cc:2:1: error: 'string' does not name a type; did you mean 'stdin'?
    2 | string a;
      | ^~~~~~
      | stdin
a.cc: In function 'int main()':
a.cc:5:10: error: 'a' was not declared in this scope
    5 |     gets(a);
      |          ^
a.cc:5:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
    5 |     gets(a);
      |     ^~~~
      |     getw
Language: C++

#include<bits/stdc++.h>
string a;
using namespace std;
int main(){
    cin>>a;
    cout<<a[0]<<a.size()-2<<a[a.size()-1];
    return 0;
}

Compiler output:
a.cc:2:1: error: 'string' does not name a type; did you mean 'stdin'?
    2 | string a;
      | ^~~~~~
      | stdin
a.cc: In function 'int main()':
a.cc:5:10: error: 'a' was not declared in this scope
    5 |     cin>>a;
      |          ^
Language: C++

#include<cstring>
#include<iostream>
string a;
using namespace std;
int main(){
    cin>>a;
    cout<<a[0]<<a.size()-2<<a[a.size()-1];
    return 0;
}

Compiler output:
a.cc:3:1: error: 'string' does not name a type; did you mean 'stdin'?
    3 | string a;
      | ^~~~~~
      | stdin
a.cc: In function 'int main()':
a.cc:6:10: error: 'a' was not declared in this scope
    6 |     cin>>a;
      |          ^
Language: C++

#include<bits/stdc++>
using namespace std;
int main(){
  string s;
  int i;
  cin >> s;
  i = s.size();
  cout << s.at(0) << i - 2 << s.at(i-1) << endl;
}

Compiler output:
a.cc:1:9: fatal error: bits/stdc++: No such file or directory
    1 | #include<bits/stdc++>
      |         ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
#include<cstdio>
using namespace std;
char s[1001],a,b;
int l=0,len=0;
int main()
{
	cin>>s;
	for(int i=0;i<strlen(s);i++)
	{
		l=strlen(s)-2;
		len=strlen(s);
		a=s[0];
		b=s[len-1];
	}
	cout<<a<<l<<b<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:23: error: 'strlen' was not declared in this scope
    9 |         for(int i=0;i<strlen(s);i++)
      |                       ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<cstdio>
  +++ |+#include <cstring>
    3 | using namespace std;
Language: C++

#include<iostream>
#include<cstdio>
using namespace std;
char s[1001],a,b;
int l=0;
int main()
{
	cin>>s;
	for(int i=0;i<strlen(s);i++)
	{
		l=strlen(s)-2;
		a=s[0];
		b=s[strlen(s)-1];
	}
	cout<<a<<l<<b<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:23: error: 'strlen' was not declared in this scope
    9 |         for(int i=0;i<strlen(s);i++)
      |                       ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<cstdio>
  +++ |+#include <cstring>
    3 | using namespace std;