Advertisement
Guest User

Untitled

a guest
Jan 20th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.46 KB | None | 0 0
  1. Program newmasiv;
  2.   Var R: array[1..100] of integer;
  3.   T: array[1..100] of integer;
  4.   U: array[1..100] of integer;
  5.   a,n, i, k, kol: integer;
  6. Begin
  7.   kol:=0;
  8.   k:=0;
  9.   write ('n=');
  10.   readln (n);
  11.   For i:=1 to n do
  12.     begin
  13.     if i mod 2=0 then
  14.       begin
  15.       T[k] = R[i];
  16.       k:=k+1;
  17.     end;
  18.     if i mod 2<>0 then
  19.       U[a] = R[i];
  20.       a:=a+1;
  21.     end;
  22.   end;
  23.     For i:=1 to k do
  24.     begin
  25.     writeln('T[',i,']=',T[i]);
  26.     end
  27. End.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement