1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<span>uses</span> crt;
<span>var</span> a<span>,</span>b<span>,</span>c<span>,</span>d<span>,</span>s1<span>,</span>s2<span>,</span>t<span>:</span><span>integer</span>; k<span>:</span><span>boolean</span>;
<span>begin</span>
clrscr;
<span>write</span><span>(</span><span>'Введите четырех значное число: '</span><span>)</span>; <span>readln</span><span>(</span>t<span>)</span>;
a<span>:=</span>t <span>div</span><span>1000</span>;
b<span>:=</span><span>(</span>t <span>mod</span><span>1000</span><span>)</span><span>div</span><span>100</span>;
c<span>:=</span><span>(</span>t <span>mod</span><span>100</span><span>)</span><span>div</span><span>10</span>;
d<span>:=</span>t <span>mod</span><span>10</span>;
s1<span>:=</span>a<span>+</span>b;
s2<span>:=</span>c<span>+</span>d;
k<span>:=</span>s1<span>=</span>s2;
<span>writeln</span><span>(</span>k<span>)</span>;
<span>readln</span><span>end</span>.
800*600 = 480000 бит = 58.6 Кб.
i=4 бита
N=2^4 = 16 цветов.
Var m,k,r:integer;
procedure buy(var m,k,r:integer);
begin;
if k<=m then
begin;
m:=m-k;
inc(r);
buy(m,k,r);
end;
end;
begin;
write('Введите сколько у Пети рублей:');
readln(m);
write('Введите стоимость мороженого:');
readln(k);
buy(m,k,r);
write('Всего:',r);
<span>end.</span>
using System;
using System.Linq;
using static System.Console;
class Program
{
static void Main()
{
int x=int.Parse(ReadLine());
var t=x.ToString().Select(n=>(int)n).Reverse().ToList();
WriteLine((t.FindIndex(n=>n==t.Max())+1).ToString());
}
}
1) 20*1024*8 /100=1638,4 ≈1638 бит/с скорость первоначально
2) 1638+512=2150 бит/с повысили скорость
3) 20*1024*8/2150≈76,204≈76 с
Ответ: 76 с