1)
<span><span>procedure Insert(source: string; var s: string; index: integer);
Вставляет подстроку source в строку s с позиции index</span><span>procedure Delete(var s: string; index, count: integer);
Удаляет из строки s count символов с позиции index
2)
var s:string; i,n,code:integer;
begin
write('Введите длинное число:');
readln(s);
for i:=1 to length(s) do
begin
val(s[i],n,code);
if code=0 then writeln(n);
end;
end.
Пример:
Введите длинное число:3456810285
3
4
5
6
8
1
0
2
8
5
Если не требуется выполнять арифметических действий с цифрами, то можно так:
var s:string; i:integer;
begin
write('Введите длинное число:');
readln(s);
for i:=1 to length(s) do writeln(s[i]);
end.</span></span>
Ответ:
var x:Real;
begin
write ('x = ');
Readln(x);
if x<0 then Write('y = ',x*x) else
if x>2 then Write('y = ',(3*x-1)/(2*x)) else
Write('y = ',sqr(x)*x+5)
end.
#include<iostream>#include<conio.h>using namespace std;
int main(){float milkPrice,bredPrice,procent; cout<<"moloko = "; cin>>milkPrice; cout<<"\nxleb = "; cin>>bredPrice; cout<<"**********************************"<<endl; cout<<"podnyat ceny na "; cin>>procent; if (procent <= 0) { cout<<"plohoy procent"; _getch(); return 0; }else{ cout<<"stariye ceni:\nXLEb: "<<bredPrice<<" \nMoloco: "<<milkPrice<<endl; cout<<"**********************************"<<endl; cout<<"new ceni:\nXLEb: "<<(bredPrice*procent/100)+bredPrice<<" \nMoloco: "<<(milkPrice*procent/100)+milkPrice; } _getch();return 0;}
Листинг программы и скриншот результата в приложениях
S = 30, если поочередно выполнять действия, а легче было бы прогу написать)