слово вводится с клавиатуры латиницей(максимум 19 символов)
#include < iostream> using std: : cout; using std: : cin; using std: : endl; #include < cstring> using std: : strlen; using std: : strcat; #include < iomanip> using std: : setw; int main(){ char s[20]; cout < < "enter the word: "; cin > > setw(20) > > s; char s2[strlen(s) * 3 + 1]; for(int i = 0; i < strlen(s); i++) { s2[i] = '*'; } s2[strlen(s)] = '\0'; strcat(s2, s); for(int i = strlen(s2); i < sizeof(s2); i++) { s2[i] = '*'; } s2[sizeof(s2)] = '\0'; cout < < s2 < < endl; return 0; }
Поделитесь своими знаниями, ответьте на вопрос: