#include <iostream>
using namespace std;
int main()
{
setlocale(LC_ALL, "RUSSIAN");
string str1;
int count=0;
cout << "Программа подсчета количества букв \"к\" строке" << endl;
str1 = "Строка";
for (int i = 0; i < str1.length(); i++)
if (str1[i] == 'к')
count++;
cout << "Буква встречается в строке " << count << " раз" << endl;
system("pause");
}
Var f: real; x :integer;
begin //Ввод writeln ('введите x'); readln (x);
//решение
f:= x-(Power(x,3)/6)+(Power(x,5)/120)-(Power(x,7)/5040)+(Power(x,9)/362880)-(Power(x,11)/39916800)+(Power(x,13)/6227020800); {f:=Power(x,2);} //вывод writeln ('f = ', f); end.
Program ugadai;
uses crt;
var
i,z,o:integer;
begin
randomize;
writeln('Введите число от 0 до 99:');
z:=random(100);
for i:= 1 to 10 do
begin
read(o);
if (o = z) then
begin
writeln('Вы угадали!!!');
break;
end else begin
if (i = 10) then begin
writeln('Жалко,но число не отгаданно.Загаданное число было ', z);
end else begin
writeln('Упс! У вас еще ',10 - i,' попопыток. Введите число:');
end;
end;
end;
<span>end.</span>
000 R = 0
001 R = 0
010 R = 1
011 R = 1
100 R = 0
101 R = 0
110 R = 0
111 R = 0
Код программы:
Var A,B,C : Boolean;
Begin
For A:=False to True do
For B:=False to True do
For C:=False to True do Writeln(Ord(A),Ord(B),Ord(C),' R = ',ord((not A) and (B or not C) and B));
end.
1) 3%от 100см
100:100*3=3 см подрастает за год
2) 100+3=103 см рост через год