Var s,s1,s2,st1,st2:string; i:integer; mn:set of char; b:boolean; begin writeln('Введите текст:'); readln(s); s:=s+' '; st1:=''; st2:=''; s1:=''; s2:=''; mn:=[]; b:=false; while pos(' ',s)>0 do delete(s,pos(' ',s),1); for i:=1 to length(s) do if s[i]<>' ' then begin s1:=s[i]+s1; s2:=s2+s[i]; if s[i] in mn then b:=true; mn:=mn+[s[i]]; end else begin if s1=s2 then st1:=st1+s1+' '; if not b then st2:=st2+s2+' '; s1:=''; s2:=''; mn:=[]; b:=false; end; if st1<>'' then writeln('Слова-перевёртыши: ',st1) else writeln('Слов-перевёртышей нет'); if st2<>'' then writeln('Слова без повторяющихся букв: ',st2) else writeln('Слов без повторяющихся букв нет'); end.
Пример: Введите текст: заказ слово комок пробел след пример огонь текст Слова-перевёртыши: заказ комок Слова без повторяющихся букв: пробел след
#include <iostream>#include <math.h>using namespace std;#include <locale.h>/* run this program using the console pauser or add your own getch, system("pause") or input loop */ int main(int argc, char** argv) { setlocale(LC_ALL,"rus"); int e, f, g, h, w; cin>>e>>f>>g>>h>>w; float a, b, c, D; a = (e+f/2)/3; b = abs(pow(h,2) - w); c = sqrt(pow(g- h,2) - 3 * sin(e)); D = pow(b,2) - 4 * a * c; cout<<"a = "<<a<<", b = "<<b<<", c = "<<c<<", D = "<<D<<"."; return 0;}
0,0(0 оценок)
Полный доступ
Позволит учиться лучше и быстрее. Неограниченный доступ к базе и ответам от экспертов и ai-bota
Оформи подписку