Какое число нужно записать вместо многоточия, чтобы в результате работы фрагмента программы были напечатаны ровно три звездочки? x:=...; while x <= 9 do begin writeln('*'); x := x + 1; end;
Программа шифровки: DATA "ауоыэяюёие" DATA "бвгджзклмнпрстфхцчшщ" DATA "ъйь" DIM s10 AS STRING, s20 AS STRING, s3 AS STRING DIM i AS INTEGER DIM s AS STRING, t AS STRING CLS READ s10, s20, s3 RANDOMIZE TIMER INPUT "Введите фразу: ", s t = "" FOR i = 1 TO LEN(s) t = t + MID$(s, i, 1) t = t + MID$(s10, INT(10 * RND + 1), 1) t = t + MID$(s20, INT(20 * RND + 1), 1) t = t + MID$(s3, INT(3 * RND + 1), 1) NEXT i PRINT t END
Программа дешифровки: DIM s AS STRING, t AS STRING, i AS INTEGER CLS INPUT "Введите фразу: ", s t = "" FOR i = 1 TO LEN(s) STEP 4 t = t + MID$(s, i, 1) NEXT i PRINT t END
Var a,b,c:array[1..20] of integer; ar:ty; n,m,k,i:integer;
procedure quicksort(var a:ty; Lo,Hi: integer);
procedure sort(l,r: integer); var i,j,x,y: integer; begin i:=l; j:=r; x:=a[random(r-l+1)+l]; repeat while a[i]<x do i:=i+1; while x<a[j] do j:=j-1; if i<=j then begin if a[i] > a[j] then begin y:=a[i]; a[i]:=a[j]; a[j]:=y; end; i:=i+1; j:=j-1; end; until i>=j; if l<j then sort(l,j); if i<r then sort(i,r); end;
begin; randomize; sort(Lo,Hi); end;
begin readln(n); for i:=1 to n do begin readln(a[i]); ar[i]:=a[i]; end; readln(m); for i:=1 to m do begin readln(b[i]); ar[i+n]:=b[i]; end; readln(k); for i:=1 to k do begin readln(c[i]); ar[i+n+m]:=c[i]; end; quicksort(ar,1,n+m+k); writeln('Final array:'); for i:=1 to n+m+k do write(ar[i]:4); end.
Пример ввода: 3 1 2 3 3 1 2 3 3 1 2 3 Пример вывода: Final array: 1 1 1 2 2 2 3 3 3
DATA "ауоыэяюёие"
DATA "бвгджзклмнпрстфхцчшщ"
DATA "ъйь"
DIM s10 AS STRING, s20 AS STRING, s3 AS STRING
DIM i AS INTEGER
DIM s AS STRING, t AS STRING
CLS
READ s10, s20, s3
RANDOMIZE TIMER
INPUT "Введите фразу: ", s
t = ""
FOR i = 1 TO LEN(s)
t = t + MID$(s, i, 1)
t = t + MID$(s10, INT(10 * RND + 1), 1)
t = t + MID$(s20, INT(20 * RND + 1), 1)
t = t + MID$(s3, INT(3 * RND + 1), 1)
NEXT i
PRINT t
END
Программа дешифровки:
DIM s AS STRING, t AS STRING, i AS INTEGER
CLS
INPUT "Введите фразу: ", s
t = ""
FOR i = 1 TO LEN(s) STEP 4
t = t + MID$(s, i, 1)
NEXT i
PRINT t
END