Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program ex9;
- uses crt;
- var
- t:array[1..50]of integer;
- x,i,a,n:integer; cha,ch:string;
- begin
- repeat
- writeln('donner N'); readln(n);
- until n in [5..50];
- for i:=1 to n do
- repeat
- writeln('t[',i,']= '); read(t[i]);
- until t[i] > 0;
- for i:=1 to n do
- begin
- cha:=''; a:=0; x := t[i];
- repeat
- a:=x mod 2;
- str(a,cha);
- ch:=ch+cha;
- x:= trunc(x div 2);
- until x = 0;
- writeln(t[i],' = ',ch);
- end;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement