CyberPascal

Untitled

Jan 8th, 2015
533
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.67 KB | None | 0 0
  1. var x:array [1..3] of longint;
  2.     st:array [1..3] of string;
  3.     i,j,k,max:byte;
  4.    
  5. Begin
  6. Write(' Введите первое число: '); Readln(X[1]);
  7. Write(' Введите второе число: '); Readln(X[2]);
  8. Writeln;
  9. X[3]:=X[1]+X[2];
  10. for i:=1 to 3 do Str(X[i],St[i]);
  11. Writeln;
  12.  
  13. Max:=Length(St[1]);
  14. for i:=1 to 3 do if (Max < Length(St[i])) then Max:= Length(St[i]);
  15.  
  16. for i:=1 to 3 do
  17.     Begin
  18.     k:=Max-Length(St[i]);
  19.     for j:=1 to k do Write(#32); Writeln(St[i]);
  20.     if (i = 2) then
  21.                    Begin
  22.                    for j:=1 to max do Write('-');
  23.                    Writeln;
  24.                    end;
  25.     end;
  26. Readln;
  27. end.
Advertisement
Add Comment
Please, Sign In to add comment