ПРОГРАММА В ПАСКАЛЕ! ВЫДАЁТ ОШИБКУ 26- несоответствие типа, но я не знаю, как это исправить. СРОЧНО!
Код Pascal
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
uses
crt;
var
a,k, m, n, q, p,v: integer;
b,d,z, i,c: real;
s:string;
function NOD(x,y:integer):integer;
Begin
If x0 then NOD:=NOD(y mod x,x) else NOD:=y;
End;
function NOK(x,y:integer):integer;
Begin
NOK:=(x div NOD (x,y))*y;
end;
begin
clrscr;
writeln (' введите m, n, p, q ');
readln (m,n,p,q);
a:= NOK(n,q);
b:= a/n ;
c:= a/q ;
d:=b*m+c*p;
s:= floattostr(d);
v:= strtoint(s);
z:=NOD (a,v);
d:=d/z;
i:=a/z;
if d=i then
writeln (m,'/',n ,'+', p,'/',q,'= ',d)
else
begin
if i=1 then
writeln(m,'/',n ,'+', p,'/',q, '= ',d)
else
writeln(m,'/',n,'+', p,'/',q,'=',d,'/',i);
end;
end.
d:=b*m+c*p; конкретно здесь
ТЕПЕРЬ ОШИБКА 3-НИЗВЕСТНЫЙ ИДЕНТИФИКАТОР floattostr