#include <iostream>
using namespace std;
int main()
{
int a, b;
cout << "Enter the dividend and divisor: " << endl;
cin >> a >> b;
if (b == 0) {
cout << "You are mistaken. The divisor can not be zero." << endl;
cin >> b;
} else {
cout << "Result: " << (double)a / b << endl;
}
return 0;
}
Var a,b:integer;
begin
writeln('Введите число');
readln(a);
writeln('Введите цифру');
read(b);
if ((a mod 10)<>b) and ((a div 10)<>b) and (a<100) then begin
a:=a+1;
write(" ",a);
end;
end.
Программы на Кумире прилагаются.
Var
c:char;
k:integer;
FlagBlank:boolean;
begin
Read(c);
case c of
'К','к':begin k:=1; FlagBlank:=True end;
' ':begin k:=0; FlagBlank:=False end;
'.':k:=0;
else begin k:=0; FlagBlank:=True end
end;
while c<>'.' do begin
while (not FlagBlank) and (c<>'.') do
begin Read(c); FlagBlank:=(c=' ') end;
while Flagblank and (c<>'.') do
begin Read(c); FlagBlank:=(c=' ') end;
if UpCase(c)='К' then Inc(k);
end;
Writeln(k);
end.
<span>10111,11(двоичное)
</span>10111,11₂ = 1*2⁴ + 0*2³ + 1*2² + 1*2 + 1 + 1*1/2 + 1*1/2² =
= 16 + 4 + 2 + 1 + 0,5 + 0,25 = 23,75₁₀ (десятичное)
<span>
306(восьмеричное)
</span>306₈ = 3*8² + 0*8 + 6 = 192 + 6 = 198₁₀ (десятичное)
<span>3В(шестнадцатеричное)
3В</span>₁₆<span> = 3*16 + 11 = 59</span>₁₀<span> (десятичное)</span>