1) const f0=1; fk=10; h=0.5; var f:real; i:integer; begin f:=f0-h; writeln('Фунты Кг'); for i:=1 to round((fk-f0)/h)+1 do begin f:=f+h; writeln(f:4:1,f*0.4:7:3); end; end.
2) const f0=1; fk=10; h=0.5; var f:real; begin f:=f0-h; writeln('Фунты Кг'); while f<fk do begin f:=f+h; writeln(f:4:1,f*0.4:7:3); end; end.
3) const f0=1; fk=10; h=0.5; var f:real; begin f:=f0-h; writeln('Фунты Кг'); repeat f:=f+h; writeln(f:4:1,f*0.4:7:3); until f>=fk; end.
const f0=1; fk=10; h=0.5;
var f:real; i:integer;
begin
f:=f0-h;
writeln('Фунты Кг');
for i:=1 to round((fk-f0)/h)+1 do
begin
f:=f+h;
writeln(f:4:1,f*0.4:7:3);
end;
end.
2)
const f0=1; fk=10; h=0.5;
var f:real;
begin
f:=f0-h;
writeln('Фунты Кг');
while f<fk do
begin
f:=f+h;
writeln(f:4:1,f*0.4:7:3);
end;
end.
3)
const f0=1; fk=10; h=0.5;
var f:real;
begin
f:=f0-h;
writeln('Фунты Кг');
repeat
f:=f+h;
writeln(f:4:1,f*0.4:7:3);
until f>=fk;
end.
Результат:
Фунты Кг
1.0 0.400
1.5 0.600
2.0 0.800
2.5 1.000
...
9.0 3.600
9.5 3.800
10.0 4.000
using namespace std;
int main()
{
int n;
int counter = 0;
cout << "Vvedite kilichestvo elementov: " << endl;
cin >> n;
int *massiv = new int[n];
for (int i = 0; i < n; i++) {
cout << "Vvedite " << i + 1 << " element: ";
cin >> massiv[i];
if (massiv[i] % 2 != 0) {
counter += 1;
}
}
cout << "Kolichestvo nechetnqh elementov = " << counter << endl;
return 0;
}