Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program DM;
- {$APPTYPE CONSOLE}
- uses
- SysUtils;
- var
- Arr: array of Integer;
- TempArr: array of Integer;
- Input, Output: string;
- i, j : Integer;
- begin
- Read(Input);
- Output := '';
- SetLength(Arr, Length(Input));
- SetLength(TempArr, Length(Input) - 1);
- for i := 0 to Length(Input) - 1 do
- Arr[i] := StrToInt(Input[i + 1]);
- for i := 0 to Length(Input) - 2 do
- begin
- Output := Output + IntToStr(Arr[0]);
- for j := 0 to Length(Arr) - 2 do
- TempArr[j] := Arr[j] xor Arr[j + 1];
- SetLength(Arr, Length(TempArr));
- for j := 0 to Length(TempArr) - 1 do
- Arr[j] := TempArr[j];
- SetLength(TempArr, Length(TempArr) - 1);
- end;
- Output := Output + IntToStr(Arr[0]);
- Write(Output);
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement