xottabыs4
12.11.2020 21:04

C++ написать программу , которая выводит на экран символы (на латинском) не относящиеся к вашему имени к примеру : egor не относящиеся символы: a b c d f h i j k l m p q s t u w y z

Нажмите на рекламу ниже и сразу увидите ответ
Популярные вопросы:
Ответ:
galina6969
04.08.2020 21:10

#include <iostream>

#include <string>

#include <cctype>

#include <algorithm>


int main()

{

std::string abc = "";


std::string name;

std::cin >> name;


for (const char &character : name)

{

 abc.erase(std::remove(abc.begin(), abc.end(), tolower(character)), abc.end());

}


for (const char &character : abc)

{

 std::cout << character << ' ';

}

std::cout << std::endl;

return 0;

}

0,0(0 оценок)
Ответ:
seregamani
04.08.2020 21:10

#include <iostream>

#include <string.h>

using namespace std;

#define MAX 128

char str[MAX], alf[MAX];

int main()

{

puts("Input name: ");

gets(str);

strlwr(str);

for(int i = 0; i <= 'z' - 'a'; i++)  

 alf[i] = 'a' + i;

for(int i = 0; i < strlen(str); i++)

 if ((str[i] >= 'a') && (str[i] <= 'z'))

  alf[str[i] - 'a'] = '0';

cout << "Letters that are not in the name: ";

for(int i = 0; i <= 'z' - 'a'; i++)  

 if (alf[i] != '0')

  cout << alf[i] << " ";

return 0;

}

0,0(0 оценок)
Полный доступ
Позволит учиться лучше и быстрее. Неограниченный доступ к базе и ответам от экспертов и ai-bota Оформи подписку
logo
Начни делиться знаниями
Вход Регистрация
Что ты хочешь узнать?
Спроси ai-бота