My code:
#include <bits/stdc++.h>
#include <iostream>
#include <string>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
while (n--) {
string word;
cin >> word;
if (word.length() > 10) {
cout << word.front() << word.length() - 2 << word.back() << endl;
} else {
cout << word << endl;
}
}
return 0;
}
Input:
4
word
localization
internationalization
pneumonoultramicroscopicsilicovolcanoconiosis
expected output:
word
l10n
i18n
p43s
Actual Output when pasted into VS Code’s external console
4
word
word
localization
l10n
internationalization
i18n
pneumonoultramicroscopicsilicovolcanoconiosis
p43s
Press any key to continue . . .
How can I configure VS Code (or Windows Terminal / cmd.exe) so that it doesn’t echo pasted input, and only shows the program’s output cleanly below?
Is there a setting in launch.json or VS Code that can fix this behavior?