Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <sstream>
- using namespace std;
- string changeLetters(string word);
- int main() {
- setlocale(LC_ALL, "Russian");
- string input = "МИНИМУМ СОСИСОК", words;
- stringstream ss;
- ss << input;
- while (ss >> words) {
- cout << changeLetters(words) << endl;
- }
- return 0;
- }
- string changeLetters(string word) {
- for (int i = 0; i < (int)word.length(); i++)
- {
- if (word[i] == word[0] && i != 0) {
- word[i] = '.';
- }
- }
- return word;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement