Way Too Long Words Codeforces solution in C++100% Accepted || Codeforces solution2023

Way Too Long Words Codeforces solution in C++ is 100% Accepted.

Popular online venue Codeforces hosts fiercely competitive design contests. It helps programmers develop their problem-solving abilities by offering algorithmic tasks for them to solve. The section in Codeforces 71A labeled “Way Too Long Words” is one issue. We will look at the CPP solution to this issue in this article.

Codeforces -71A. Way Too Long Words question link

Understanding the issue

The unsettling message in “Way Too Long Words” is simple. It necessitates that we reduce terms that may be overly long due to specific circumstances. The entry consists of an integer ‘n’ followed by ‘n’ words. If the period of a word exceeds 10 characters, we want to update it with a new string that comprises the initial letter, the number of letters between the first and last letters (different), and the last letter.

Way Too Long Words Codeforces Solution in C++

#include<iostream>
#include<string>
using namespace std;
int main()
{
int n;
string s;
cin>>n;
for (int i=0;i>s;
int b=s.length();

 if(b>10)
   {
       cout<<s[0]<<b-2<<s[b-2]<<endl;//Way too long words solution
   }
   else
   {
       cout<<s<<endl;
   }
}
return 0; 
}

Next problem: Codeforces 1A. Theatre Square Solution in C/CPP

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top
NEW TOXIC ROCKET CYCLE DECK in Clash Royale 2023 Best Deck in Clash Royale Best Deck for Arena 8 in Clash Royale Best Hog deck for Pro players Best Clash Royale Deck