Computer is one of the best inventions of the 20th century. It's hard to believe that one small screen with a keyboard can change everybody's life.
letters would be delivered instantly to the addressee,music can be downloaded in a few seconds,millions of documents can be kept on one device,the quality of photos can be easily improved,video calls can reduce distance between friends and relatives, etc.All this became possible with the appearance of computers. In my opinion this smart device has changed the world. My life has also significantly changed when I first started using the computer. Today I'm literally dependent on it because there are many things computer can do for me. First of all, I try to stay in touch with my friends and English pen pals. In this case I use either e-mails or social networks, such as Facebook or Vkontakte. Social networks are even more convenient. There you can see whether your companion is online or not, you can also follow your friends' news. Messages are delivered instantly, so the answer should be quick. E-mails are also good, but you don't know how soon your friend will check the box, so the answer can take some time.
Apart from Internet and its advantages, I use my computer in studying. Projects and essays are part of my home work. That's why I often use editing programs, such as Word, Excel, PowerPoint. Another frequently used program for me is Skype. Since its creation distance between people has notably reduced. You can video call your friends or relatives for free and speak as much as you wish. I also like keeping photos and music on my computer. Photos can be edited by a special program called Photoshop. It is rather handy, when someone wants to improve the quality of pictures or change the size. When I have free time I read e-books or play some games on computer.
It is obvious than people can do a lot of things with the help of this multitask invention. In our technological era people can't live without computers. They are nearly addicted to this device, but there are some drawbacks as well. First of all, spending a lot of time in front of the computer results in eyesight deterioration. Secondly, people can gain excessive weight if sitting for too long without physical exercise. Thirdly, computer and particularly Internet sometimes provides too much unnecessary information, violence and hidden dangers.
// PascalABC.NET 3.3.5, сборка 1644 от 23.03.2018 // Внимание! Если программа не работает, обновите версию!
function aToDec(n:string;k:integer):string; // Перевод из системы по основанию k в десятичную begin var s:='0123456789ABCDEF'; Result:=''; var PointPos:=Pos('.',n); if PointPos>0 then begin // есть дробная часть var sFracPart:=n[PointPos+1:]; var r:=0.0; var p:=k; foreach var c in sFracPart do begin r+=(Pos(c,s)-1)/p; p*=k; end; Result:=r.ToString[2:] end else PointPos:=n.Length+1; var pa:=1; n:=n[:PointPos]; var p:=0; foreach var c in n.Reverse do begin p+=pa*(Pos(c,s)-1); pa*=k end; Result:=p.ToString+Result end;
function DecToa(n:string;k:integer):string; // Перевод из десятичной системы в систему по основанию k begin var s:='0123456789ABCDEF'; Result:=''; var PointPos:=Pos('.',n); var IntPart:integer; if PointPos>0 then begin // есть дробная часть var FracPart:=Frac(n.ToReal); var m:=0; while True do begin var r:=FracPart*k; Result+=s[Trunc(r)+1]; FracPart:=Frac(r); m+=1; if (m=15) or (FracPart=0) then break end; IntPart:=n[:PointPos].ToInteger; end else IntPart:=n.ToInteger; if Result<>'' then Result:='.'+Result; while IntPart>0 do begin Result:=s[IntPart mod k+1]+Result; IntPart:=IntPart div k end; if Result='' then Result:='0'; if Result[1]='.' then Result:='0'+Result end;
function AtoB(s:string;A,B:integer):string; // Перевод из системы по основанию A в систему по основанию B begin if A=10 then Result:=DecToa(s,B) else if B=10 then Result:=aToDec(s,A) else Result:=DecToa(aToDec(s,A),B) end;
begin var n:=ReadlnString('Какое число перевести?'); var (a,b):=ReadInteger2('Исходное и результирующее основания:'); Writeln(n,'(',a,') = ',AtoB(n,a,b),'(',b,')'); end.
Пример Какое число перевести? 345.653 Исходное и результирующее основания: 8 16 345.653(8) = E5.D58(16)
Computer is one of the best inventions of the 20th century. It's hard to believe that one small screen with a keyboard can change everybody's life.
letters would be delivered instantly to the addressee,music can be downloaded in a few seconds,millions of documents can be kept on one device,the quality of photos can be easily improved,video calls can reduce distance between friends and relatives, etc.All this became possible with the appearance of computers. In my opinion this smart device has changed the world. My life has also significantly changed when I first started using the computer. Today I'm literally dependent on it because there are many things computer can do for me. First of all, I try to stay in touch with my friends and English pen pals. In this case I use either e-mails or social networks, such as Facebook or Vkontakte. Social networks are even more convenient. There you can see whether your companion is online or not, you can also follow your friends' news. Messages are delivered instantly, so the answer should be quick. E-mails are also good, but you don't know how soon your friend will check the box, so the answer can take some time.Apart from Internet and its advantages, I use my computer in studying. Projects and essays are part of my home work. That's why I often use editing programs, such as Word, Excel, PowerPoint. Another frequently used program for me is Skype. Since its creation distance between people has notably reduced. You can video call your friends or relatives for free and speak as much as you wish. I also like keeping photos and music on my computer. Photos can be edited by a special program called Photoshop. It is rather handy, when someone wants to improve the quality of pictures or change the size. When I have free time I read e-books or play some games on computer.
It is obvious than people can do a lot of things with the help of this multitask invention. In our technological era people can't live without computers. They are nearly addicted to this device, but there are some drawbacks as well. First of all, spending a lot of time in front of the computer results in eyesight deterioration. Secondly, people can gain excessive weight if sitting for too long without physical exercise. Thirdly, computer and particularly Internet sometimes provides too much unnecessary information, violence and hidden dangers.
// Внимание! Если программа не работает, обновите версию!
function aToDec(n:string;k:integer):string;
// Перевод из системы по основанию k в десятичную
begin
var s:='0123456789ABCDEF';
Result:='';
var PointPos:=Pos('.',n);
if PointPos>0 then begin // есть дробная часть
var sFracPart:=n[PointPos+1:];
var r:=0.0;
var p:=k;
foreach var c in sFracPart do begin
r+=(Pos(c,s)-1)/p;
p*=k;
end;
Result:=r.ToString[2:]
end
else PointPos:=n.Length+1;
var pa:=1;
n:=n[:PointPos];
var p:=0;
foreach var c in n.Reverse do begin
p+=pa*(Pos(c,s)-1);
pa*=k
end;
Result:=p.ToString+Result
end;
function DecToa(n:string;k:integer):string;
// Перевод из десятичной системы в систему по основанию k
begin
var s:='0123456789ABCDEF';
Result:='';
var PointPos:=Pos('.',n);
var IntPart:integer;
if PointPos>0 then begin // есть дробная часть
var FracPart:=Frac(n.ToReal);
var m:=0;
while True do begin
var r:=FracPart*k;
Result+=s[Trunc(r)+1];
FracPart:=Frac(r);
m+=1;
if (m=15) or (FracPart=0) then break
end;
IntPart:=n[:PointPos].ToInteger;
end
else IntPart:=n.ToInteger;
if Result<>'' then Result:='.'+Result;
while IntPart>0 do begin
Result:=s[IntPart mod k+1]+Result;
IntPart:=IntPart div k
end;
if Result='' then Result:='0';
if Result[1]='.' then Result:='0'+Result
end;
function AtoB(s:string;A,B:integer):string;
// Перевод из системы по основанию A в систему по основанию B
begin
if A=10 then Result:=DecToa(s,B)
else
if B=10 then Result:=aToDec(s,A)
else Result:=DecToa(aToDec(s,A),B)
end;
begin
var n:=ReadlnString('Какое число перевести?');
var (a,b):=ReadInteger2('Исходное и результирующее основания:');
Writeln(n,'(',a,') = ',AtoB(n,a,b),'(',b,')');
end.
Пример
Какое число перевести? 345.653
Исходное и результирующее основания: 8 16
345.653(8) = E5.D58(16)