#include "stdafx.h" #include #include #include using namespace std; int main() { setlocale(0, "rus"); cout<<"Введите слова:\n>> "; char st[100]; gets(st); cout<> "; int k; cin>>k; cout<strlen(st)) k=strlen(st); //eсли длина строки меньше, чем номер символа, нет смысла продолжать цикл после '\0' while(st[k-1]==' ') //удаляем ненужные пробелы после последнего слова k--; cout<<"For testing purposes only: "<