Program velobike;
Uses crt,graph;
Var gr:integer;
gm:integer;
x,y:integer;
begin
gr:=detect;
initgraph(gr,gm,'..\bgi');
x:=600;
y:=250;
repeat
for x:=0 to 600 do
begin
cleardevice;
setbkcolor(8);
setcolor(2);
setlinestyle(1,0,1);
rectangle(1,3,639,475);
setfillstyle(1,6);
bar(2,280,638,475);
setcolor(6);
setfillstyle(1,2);
circle(x-150,y,27);
floodfill(x-140,y-10,6);
setcolor(yellow);
circle(x-150,y,3);
setcolor(6);
setfillstyle(1,2);
circle(x-0,y,27);
floodfill(x-0,y-10,6);
setcolor(yellow);
circle(x-0,y,3);
setcolor(yellow);
circle(x-70,y,10);
circle(x-70,y,2);
setcolor(yellow);
arc(x-150,y,355,190,30);
arc(x-0,y,445,200,30);
setcolor(2);
setlinestyle(0,0,2);
line(0,280,639,280);
setcolor(white);
setlinestyle(0,2,3);
moveto(x-110,y-50);
lineto(x-15,y-50);
moveto(x-150,y);
lineto(x-70,y);
lineto(x-10,y-35);
moveto(x-70,y);
lineto(x-110,y-50);
moveto(x-150,y);
lineto(x-110,y-50);
moveto(x-150,y);
lineto(x-170,y-35);
lineto(x-123,y-35);
moveto(x-0,y);
lineto(x-20,y-73);
lineto(x-40,y-60);
moveto(x-20,y-73);
lineto(x-12,y-90);
moveto(x-150,y);
lineto(x-180,y-10);
moveto(x-0,y);
lineto(x-30,y);
setcolor(6);
setlinestyle(0,0,1);
moveto(x-70,y);
lineto(x-55,y-20);
setcolor(red);
lineto(x-45,y-20);
setcolor(8);
moveto(x-70,y);
lineto(x-75,y+20);
setcolor(6);
lineto(x-85,y+20);
setcolor(6);
moveto(x-110,y-50);
lineto(x-115,y-63);
setcolor(red);
moveto(x-40,y-60);
lineto(x-50,y-60);
moveto(x-12,y-90);
lineto(x-22,y-90);
setcolor(red);
setlinestyle(0,0,3);
moveto(x-123,y-63);
lineto(x-103,y-63);
delay(10000);
end;
settextstyle(0,0,3);
cleardevice;
setcolor(red);
outtextxy(30,240,'XoTuTe IIocMoTpeTb eLLLe?');
outtextxy(100,280,' Ha}|{MuTe Enter ');
readln;
until keypressed;
readln;
closegraph;
end.
Python 3.7.2
#-*- encoding: utf-8 -*-
__author__ = 'unchpokable'
import re
import string
#reading_text
path = input('Enter absolute path to file: \n')
with open(path, 'r', encoding = 'utf-8') as txt:
text = txt.read()
#reading_text_end
text = re.sub(rf'[{string.punctuation}]|\n', ' ', text)
text = re.sub(r' +', ' ', text)
for word in set(text.split(' ')):
if text.count(word) > 1: print(f'Слово {word} встречается больше одного раза')
Объяснение:
Предполагается считывание текста из текстового файла.
Если достаточно ввести текст в консоль, замените строки, находящиеся между метками #reading_text и #reading_text_end на
text = input()
2) 2^7=128. Глубина цвета 128
3) 512=2^9. Для каждого цвета выделяется 9 бит
4) Количество пикселей (точек)=256*512=(2^8)*(2^9)=2^(8+9)=2^17 px.
Определим вес каждого пикселя: 16=2^4, те каждый пиксель весит 4 бита
Вес картинки=(2^17)*4=(2^17)*(2^2)=2^(17+2)=2^19 бит=(2^19):(2^13)=2^6=64 Кбайта
5) вес изображения 64 Кбайта=(2^6)*(2^13) бит=2^19 бит.
Количество пикселей=1024*512=(2^10)*(2^9)=2^19 px
Вес каждого пикселя: 2^19 бит/2^19 px=1 бит
Количество цветов в палитре=2^1=2 цвета в палитре
6) Палитра RGB (Red-Green-Blue), по 2 шестнадцатеричной цифры на цвет.