**Before watching this make sure that you’ve tried enough**
#include<iostream> #include<string> using namespace std; int main() { string s; int n; in >> n; for(int I = 0; I < n; i++) { cin >> s; if(s.length() > 10) { cout << s[0] << s.length() - 2 << s[s.length() - 1] << endl; } else cout << s << endl; } }
If this solution helped you, please share this with your friends.