#include <string>
#include <algorithm>
#include <iostream>
int main()
{
string str;
string str1;
int h = 0;
cin >> str;
if (str.length() > 10)
{
str1 += str.front();
h = str.length() - 2;
string s = to_string(h);
str1 += s;
str1 += str.back();
cout << str1;
}
else cout << str;
return 0;
}
在 XCode 中编译,但在 codeforces.ru/ 上没有
сan't compile program.cpp:
program.cpp: In function 'int main()':
program.cpp:23:21: error: 'std::string' has no member named 'front'
program.cpp:27:29: error: 'to_string' was not declared in this scope
program.cpp:32:21: error: 'std::string' has no member named 'back'