Program z18; Var a: array [1..1000] of string; i,j,l,min,h:integer; s:string;Begin write('Введите строку - '); readln(s); l:=s.Length; i:= 1; j:= 1; while i <= l do begin while (s[i] <> ' ') and (i <= l) do begin a[j]:=a[j] + s[i]; i:= i + 1; if (i > l) then break; end; j:= j + 1; i:= i + 1; end; i:= 2; min:=a[1].Length; while (a[i] <> '') do begin l:=a[i].Length; if (l < min) then h:= i; i:= i + 1; end; writeln(a[h]);End.
Program z19; Var a: array [1..1000] of string; i,j,l,min:integer; s:string;Begin write('Введите строку - '); readln(s); l:=s.Length; i:= 1; j:= 1; while i <= l do begin while (s[i] <> ' ') and (i <= l) do begin a[j]:=a[j] + s[i]; i:= i + 1; if (i > l) then break; end; j:= j + 1; i:= i + 1; end; i:= 1; while (a[i] <> '') do begin if ((a[i] = 'мое') or (a[i] = 'Мое')) then a[i]:= 'наше'; write(a[i], ' '); i:= i + 1; end;End.
с++
#include<iostream.h>
int main(int argc, char* argv[])
{ setconsolecp(1251);
setconsoleoutputcp(1251);
float a,b,c;
cout<<"\nвведите 3 числа"<<endl;
cout<<'\na="; cin>>a>>endl;
cout<<"\nb="; cin>>b>>endl;
cout<<"\nc"; cin>>c>>endl;
cout << "RAND_MAX = " << RAND_MAX << endl; cout << "random number = " << rand() << endl;
cin>>rand()>>(a,b,c)>>endl;
system (pause);
return 0;
}
Program z19; Var a: array [1..1000] of string; i,j,l,min:integer; s:string;Begin write('Введите строку - '); readln(s); l:=s.Length; i:= 1; j:= 1; while i <= l do begin while (s[i] <> ' ') and (i <= l) do begin a[j]:=a[j] + s[i]; i:= i + 1; if (i > l) then break; end; j:= j + 1; i:= i + 1; end; i:= 1; while (a[i] <> '') do begin if ((a[i] = 'мое') or (a[i] = 'Мое')) then a[i]:= 'наше'; write(a[i], ' '); i:= i + 1; end;End.