1. Если алфавит племени содержит 67 символа, то его символы можно закодировать числами от 0 до 66. В двоичном коде для представления чисел такого диапазона потребуется 7 бит (т.к. 2^6=64 не подходит значит 2^7= 128
Ответ: потребуется код разрядности 7 бит.
2. Пятиразрядный двоичный код позволяет закодировать символа с кодами от 0 до 31
Ответ: 31
3)8 бит - это 2^8 = 256 значений.
Ответ 256.
#include "stdafx.h"
#include <iostream>
#include <math.h>
#include<stdio.h>
using namespace std;
#define PI 3.14159265
int main ()
{
double a;
cout<<"Input a: ";
cin>>a;
cout<<endl;
if ( (a*cos((78.0)*PI / 180.0 ))<((0.2)*cos ( (81.0) * PI / 180.0 )) )
{
<span> cout<<"a*cos(78) < 0,2cos(81)";</span>
}else
{
if ((a*cos ( (78.0) * PI / 180.0 ))==((0.2)*cos ( (81.0) * PI / 180.0 )))
{
cout<<"a*cos(78) = 0,2cos(81)";
}else
{
cout<<"a*cos(78) > 0,2cos(81)";
}}
system("PAUSE");
return 0;}<span>
</span>
Program red;
var a,b,c:integer;
begin
b:=0;
readln(a);
if a<10 then
begin
if a*5=0 then b:=1;
end;
if (a>=10) and (a<100) then
begin
if ((a div 10)*5=0) then b:=1;
if ((a mod 10)*5=0) then b:=1;
end;
if (a>=100) and (a<1000) then
begin
if ((a div 100)*5=0) then b:=1;
if (((a div 10) mod 10)*5=0)then b:=1;
if ((a mod 10)*5=0)then b:=1;
end;
if b=1 then writeln('yes') else writeln('no');
end.
Вот задача. Выводит номер элемента массива и само значение.