Чёрный ящик
Тестирование методом «Чёрного ящика» один из понять, правильно или нет работает программа. Скажу Вам честно, программа работает правильно, важно понять, что она делает!
Ada is a structured, statically typed, imperative, wide-spectrum, and object-oriented high-level computer programming language, extended from Pascal and other languages.
1 1 3 1 2 1 0 3 1 4 1 0 1 0 1
It has built-in language support for design-by-contract, extremely strong typing, explicit concurrency, offering tasks, synchronous message passing, protected objects, and non-determinism.
0 1 3 0 1 2 4 4 2 0 2 0 0 0 1 0 0 1
Ada improves code safety and maintainability by using the compiler to find errors in favor of runtime errors.
0 4 3 2 2 3 1 2 0 0 0 0 0 0 1
A large number of compile-time checks are supported to help avoid bugs that would not be detectable until run-time in some other languages or would require explicit checks to be added to the source code.
Запишите через пробел цифры, которые соответствуют строке
p,p1,p2,max,min:integer;
begin
writeln('Введите строку:');
readln(s);
ss:=s+' ';
max:=0; min:=255;
p:=pos(' ',ss);
while p>0 do
begin
if p>max then begin max:=p; s1:=' '+copy(ss,1,p); end;
if p<min then begin min:=p; s2:=' '+copy(ss,1,p); end;
delete(ss,1,p);
p:=pos(' ',ss);
end;
s:=' '+s+' ';
p1:=pos(s1,s);
p2:=pos(s2,s);
if p1>p2
then begin delete(s,p1,max+1); insert(s2,s,p1); delete(s,p2,min+1); insert(s1,s,p2); end
else begin delete(s,p2,min+1); insert(s1,s,p2); delete(s,p1,max+1); insert(s2,s,p1); end;
s:=trim(s);
writeln(s);
end.
Пример:
Введите строку:
поменяйте местами самое длинное и самое короткое слово
и местами самое длинное поменяйте самое короткое слово